Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to add a value to another value?

Asked by 4 years ago
while true do 
    game.Players.LocalPlayer.leaderstats.Parts.value = game.Players.LocalPlayer.leaderstats.Parts.value + game.Players.LocalPlayer.leaderstats.PPS.value
    wait(1)
end

How can i make this add the PPS value to the Parts value?

0
Note that increasing the value on the client like you have here (you use LocalPlayer) will not replicate for the server to see. Basically meaning the server wont know that a leaderstat value was changed. You'll need to change this if you decide to use something like DataStore service. xPolarium 1388 — 4y
0
I found out i need to use RemoteEvents. TinyHooman 2 — 4y
0
That seems to be why my DataStore tests weren't working. TinyHooman 2 — 4y

2 answers

Log in to vote
0
Answered by
royaltoe 5144 Moderation Voter Community Moderator
4 years ago

Capitalize your V in value

    game.Players.LocalPlayer.leaderstats.Parts.Value game.Players.LocalPlayer.leaderstats.Parts.Value + game.Players.LocalPlayer.leaderstats.PPS.Value

Ad
Log in to vote
0
Answered by 4 years ago
while true do 
    game.Players.LocalPlayer.leaderstats.Parts.Value = game.Players.LocalPlayer.leaderstats.Parts.Value + game.Players.LocalPlayer.leaderstats.PPS.Value
    wait(1)
end

I've capitalized the V, still doesn't add the value.

0
please modify your question or comment on the answer, rather than posting an answer as a responce theking48989987 2147 — 4y

Answer this question