So I'm working on a basic little script, learning the basics of Lua math.
number1 = script.Parent.Name; --The name is 0
number2 = 1;
number3 = 10;
number4 = 40;
function onTouched(hit)
print(number1+number2)
script.Parent.Name = (number1+number2)
wait()
end
script.Parent.Touched:connect(onTouched)
This is where I am at now, is there a simpler way to do this? When I go to test this, It only goes to 1, and when I go to touch it again it still gives me 1.

3 comments
accept and +1 if it works!
Don't have enough rep to +1 you, I would though.
Im pretty sure "number1 = script.Parent.Name" is a string and not a number, you shouldn't be able to add them up unless Roblox turns it into a number automaticly.