#Help

1 messages · Page 1 of 1 (latest)

radiant cliff
#

I have made some code and ive checked it lots of times but it just wont work. Everthing that is in stats in replicated storage is a number value but when I change the multiplication it still acts as if it was 1
local Points = game.ReplicatedStorage.Stats.Points
local PPS = game.ReplicatedStorage.Stats.PPS
local Mu = game.ReplicatedStorage.Stats.Mu
while wait(1) do
Points.Value = (Points.Value + PPS.Value) * Mu.Value
end

arctic robin
radiant cliff
#

How?

quick cryptBOT
#

studio** You are now Level 6! **studio

arctic robin
#
like this
radiant cliff
#

'local Points = game.ReplicatedStorage.Stats.Points
local PPS = game.ReplicatedStorage.Stats.PPS
local Mu = game.ReplicatedStorage.Stats.Mu
while wait(1) do
Points.Value = (Points.Value + PPS.Value) * Mu.Value
end

arctic robin
#

three `

#

at both ends

radiant cliff
#

local Points = game.ReplicatedStorage.Stats.Points local PPS = game.ReplicatedStorage.Stats.PPS local Mu = game.ReplicatedStorage.Stats.Mu while wait(1) do Points.Value = (Points.Value + PPS.Value) * Mu.Value end

#

ahh

#

local Points = game.ReplicatedStorage.Stats.Points local PPS = game.ReplicatedStorage.Stats.PPS local Mu = game.ReplicatedStorage.Stats.Mu while wait(1) do Points.Value = (Points.Value + PPS.Value) * Mu.Value end

arctic robin
radiant cliff
#
local Points = game.ReplicatedStorage.Stats.Points
local PPS = game.ReplicatedStorage.Stats.PPS
local Mu = game.ReplicatedStorage.Stats.Mu
while wait(1) do
    Points.Value = (Points.Value + PPS.Value) * Mu.Value
end
arctic robin
#

good

#

now what is the problem

radiant cliff
#

the multiplication wont work

#

everything else works

arctic robin
#

hmm

#

did you make sure it's on a global script and not a local one?

regal dragon
#

@radiant cliff you changed the value on client so that won't work

arctic robin
#
local Points = game.ReplicatedStorage.Stats.Points
local PPS = game.ReplicatedStorage.Stats.PPS
local Mu = game.ReplicatedStorage.Stats.Mu
while wait(1) do
    print((Points.Value + PPS.Value) * Mu.Value)
    Points.Value = (Points.Value + PPS.Value) * Mu.Value
end
regal dragon
#

Change it on server side

arctic robin
#

yes

radiant cliff
#

How?

#

move the script?

arctic robin
#

the server will be outlined green

regal dragon
radiant cliff
#

this?

regal dragon
#

Yeah

#

And now change the value, go back on client and that will work

radiant cliff
#

how do I make the script constantly like that

#

???

regal dragon
#

You need to know that when client (the player change value) on his side, that don't affect the server as the system is in a server script

radiant cliff
#

how do I make it a client to server script then?

regal dragon
#

If you want to be able to change the value on client then put the system in a local script but I advise you to dont do that to prevent abusing and cheating

#

Players must not be able to access main game script

#

They must just access scripts related to ui etc

radiant cliff
#

how would I do it without a local

regal dragon
#

Do what?

radiant cliff
#

the script

#

so users dont cheat

regal dragon
#

Huh?

radiant cliff
regal dragon
#

If the script is local - > player can get data from it etc
If the script is server - > player can't get data from it

radiant cliff
#

oh

#

@regal dragon it breaks. if I do that nothing works

regal dragon
#

What did you do?

#

And send a screenshot of the output

radiant cliff
#

nothing...

regal dragon
#

Tell what did you do exactly

radiant cliff
#

I put the code into a localscript

#

and disabled the old one

regal dragon
#

Why?

#

Did you read what I said?

radiant cliff
#

If the script is local - > player can get data from it etc

#

If the script is server - > player can't get data from it

regal dragon
#

I didn't explain well then

#

Malicious players can try to cheat in your game so if you put main system in a local script they could abuse it but if you put it in a server script the script is protected from being modified by players

#

Local script are only to be related on player things like ui animation etc

#

Btw local script needs to be in starter player / starter player scripts / starter character scripts or starter GUI

radiant cliff
#

how would I just fix it how it is?

#

the addition works

#

its just the multiplication

regal dragon
#

As I said before

radiant cliff
#
local PPS = game.ReplicatedStorage.Stats.PPS
local Mu = game.ReplicatedStorage.Stats.Mu
while wait(1) do
    Points.Value = (PPS.Value * Mu.Value) + Points.Value
end```
regal dragon
#

While testing go on server side to change value, if you do it on client side the multiplicator value won't change

radiant cliff
#

how do I make it work if a client changes it?

regal dragon
#

Idk

#

I don't even know if it's possible

radiant cliff
#

can there be a script / s that do it on a server side and send it back?

regal dragon
#

why you want to change the value on client side?

regal dragon
radiant cliff
#

its a upgrade tree game

regal dragon
radiant cliff
#

how do I fire remote events?

regal dragon
#

Never allow player to change value on their side to avoid abusing

radiant cliff
#

and send back?

regal dragon
radiant cliff
#

@regal dragon would RemoteFunctions work?

#

nvm

#

i dont need anything back

regal dragon
#

Yeah

radiant cliff
#

where would I put the RemoteEvent:FireServer(...) ? @regal dragon

regal dragon
#

If you don't even know that then go first on roblox docs and learn about them