I created a Brick where once you step on it, it adds a 1 to a surface GUI. I'm stuck on how to have it add by 1 each time. So you step on it and it goes to "1", and the next time you step on it the surface gui goes to "2"
But as of right now it only goes to "1" any help?
function onTouch(hit) game.Workspace.SurfaceGui.SurfaceGui.TextLabel.Text = 1 end script.Parent.Touched:connect(onTouch)
So it is just displaying 1 because it is adding to nothing! Easy fix, this should work
local val = 0 function onTouch(hit) local num = val + 1 game.Workspace.SurfaceGui.SurfaceGui.TextLabel.Text = num end script.Parent.Touched:connect(onTouch)