local gui = game.StarterGui.PointsGui.PointsFrame.Points
function onTouched(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local number = 0
number = number + 1
gui.Text = number
end
end
script.Parent.Touched:connect(onTouched)
What it's supposed to do: There is a gui on the left side of the screen that says how many points you have, and every time you touch this brick, the points(the text in the gui) is supposed to go up. It isnt giving me an error message, it just doesnt work

5 comments
I've never seen a better explanation before, thank you so much!!
If you dont mind me asking though, what does line number 06 mean? (local number = tonumber(gui.Text)
tonumber converts a string to a number, if possible. So "25" becomes 25. If the string is something like "Hello!", however, tonumber will just return nil, which is what line 7 is for.
It's changing the string gui.Text into a number. This will result in one of two things, if the string actually is a number it will return that number. Otherwise if you have something like "123a", then the tonumber function will return nil as there is that "a" in there. I have on line 7 to check if the number is actually a number or not.
Thank you! And Im really sorryu :| but could you also tell me how to get it so it doesnt just give me one point?