Okay, so I'm making a "real life simulator" game. And I want the toaster to do more damage the hotter it gets.
So I have 2 scripts, one is damage, the other is adding to damage.
This one is for the damage itself when touched:
Damage = script.Parent:WaitForChild("Damage").Value
script.Parent.Touched:connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
local Humanoid = hit.Parent:WaitForChild("Humanoid")
hit.Parent.Humanoid.Health = Humanoid.Health - Damage
end
end)
And here's the one to add to the Damage Value: (It's inside of the value)
Value = script.Parent.Value
while true do
script.Parent.Value = Value + 5
wait(1)
end
The damage does -5, but I don't know why the value isn't going up.
I'm new to using values like this.

1 comment
Thanks for improving the damage script, but it's still not adding to the value when I check on it in workspace while on play solo mode