I wrote a script so when part touched it does this:
collected = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("character") then
if collected == false then
collected = true
hit.Parent.Energy.Value = hit.Parent.Energy.Value + 555
hit.Parent.Humanoid:TakeDamage(-20)
hit.Parent.Stamina.Value = hit.Parent.Stamina.Value + 50
hit.Parent.Humanoid.WalkSpeed = hit.Parent.Humanoid.WalkSpeed + 1
hit.Parent.Humanoid.JumpPower = hit.Parent.Humanoid.JumpPower + 1
print("collected")
for i = 0,1,.1 do
script.Parent.Transparency = i
script.Parent.Size = Vector3.new(i,i,i)
wait()
end
script.Parent:Destroy()
end
end
end)
So the values dont function correctly
hit.Parent.Energy.Value = hit.Parent.Energy.Value + 555
--hit.Parent.Humanoid:TakeDamage(-20) works
hit.Parent.Stamina.Value = hit.Parent.Stamina.Value + 50
--hit.Parent.Humanoid.WalkSpeed = hit.Parent.Humanoid.WalkSpeed + 1 works
--hit.Parent.Humanoid.JumpPower = hit.Parent.Humanoid.JumpPower + 1 works
The nergy Value inside player is 1000 i even CHECKED, and when this goes through (i made debug so i know this line is executed) it sets value to 555, not 1000 + 555,
hit.Parent.Energy.Value = hit.Parent.Energy.Value + 555
Before: energy.value is 1000 After: energy.value is 555 and not 1555.
Please help!

3 comments
When you changed your energy value to 1000, did you do it on the server (Script) or the client (LocalScript)?
Normal script, but if normal scritps dont work, why did the values change at all?
well initially my thought was you made the energy be 1000, on the client (so the server is 0), but upon trying this it seemed to work, mind if i have a look?