Hello! this is Jaison here and I was wondering if someone could help me fix my script. What I am trying to do in this script is when you touch a part you earn a point, but when you touch it again it wont give you a point here's the code:
local wins = game.Players.leaderstats.wins local player = game.Players.LocalPlayer local debounce = false local mouse = player:GetMouse() local G_ = script.Parent
G_.Touched:Connect(function(hit) while wait() do if hit.Parent == player.Character then if not debounce then debounce = true
wins.Value = wins.Value ~= 1
G_.TouchEnded:Connect(function()
debounce = false
end)
end
end
end
end)
You can DM me on discord JDev#4583

1 comment
can you please edit it and format it properly, i might be able to help then