I just want to expand on this (based on touching a part and a value going up):
function onTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") if (humanoid ~= nil) then game.Players.LocalPlayer.leaderstat.Status.Value + 2 wait(0.003) script.Parent:Destroy() end end script.Parent.Touched:connect(onTouch)
1 function onTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") if (humanoid ~= nil) then game.Players.LocalPlayer.leaderstat.Status.Value = game.Players.LocalPlayer.leaderstat.Status.Value + 2 -- <-- Just Repeat the Line of Code and add + 2 at the end. wait(0.003) script.Parent:Destroy() end end script.Parent.Touched:connect(onTouch)
Your savior is here man xD (jk don't be mad at me please)
What you want there up, is to get the value you have, and add 2 to the value itself right?
When doing maths, you can also use values from locations. Here, I'll give you an example.
anything.Value = anything.Value + 2 --In here we're adding 2 to the value. You can do the same with multiplying (*), dividing (/), and taking (-).
In your case, the code would be this:
function onTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") if (humanoid ~= nil) then game.Players.LocalPlayer.leaderstats.Status.Value = game.Players.LocalPlayer.leaderstats.Status.Value + 2 wait(.003) script.Parent:Destroy() end end script.Parent.Touched:connect(onTouch)
If this works, please mark as correct, and good scripting! :>