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
#Help
1 messages · Page 1 of 1 (latest)
please change the code to lua format using three `
How?
** You are now Level 6! **
like this
'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
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
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
Watch the vid
yes
@radiant cliff you changed the value on client so that won't work
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
Change it on server side
yes
While on testing go to home menu
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
how do I make it a client to server script then?
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
how would I do it without a local
Do what?
Huh?
If the script is local - > player can get data from it etc
If the script is server - > player can't get data from it
nothing...
Tell what did you do exactly
If the script is local - > player can get data from it etc
If the script is server - > player can't get data from it
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
how would I just fix it how it is?
the addition works
its just the multiplication
As I said before
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```
While testing go on server side to change value, if you do it on client side the multiplicator value won't change
how do I make it work if a client changes it?
can there be a script / s that do it on a server side and send it back?
why you want to change the value on client side?
Yeah by using remote events
the player changes it by buying a plate
its a upgrade tree game
Use remote events
how do I fire remote events?
Never allow player to change value on their side to avoid abusing
and send back?
Read docs about remote events to understand them first
Yeah
where would I put the RemoteEvent:FireServer(...) ? @regal dragon
If you don't even know that then go first on roblox docs and learn about them