Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to add a value to another value?

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?

3 comments

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.

0

I found out i need to use RemoteEvents.

0

That seems to be why my DataStore tests weren't working.

2 answers

Capitalize your V in value

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

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.

1 comment

0

please modify your question or comment on the answer, rather than posting an answer as a responce

This discussion is preserved as it was. New answers, comments, and votes are closed.