I'm new to the language, and I'm having trouble with a script that adds one point when it is touched. Eventually, I want to make it loop and add one point every second, but for now, I'm just trying to make the main script work, but it's not and I'm not sure why? Could someone inform me what I'm doing wrong?
Points = game.Players.PlayerAdded.leaderstats.Score
local Debounce = true
function onTouch()
if Debounce then
Debounce = false
Points = Points + 1
end
end
script.Parent.Touched:connect(onTouch)

1 comment
What is Score a number value?