hi, i am having trouble with a point giver part. i want to be able to step on this part, and it will repeat changing leaderstats, and waiting 0.5 seconds.
local val = 0
local maxval = 1
script.Parent.Touched:Connect(function(hit)
local a = hit.Parent:WaitForChild(‘Humanoid’)
if a ~=nil then
local ls = game.Players:GetPlayerFromCharacter(hit.Parent)
if maxval > val then
ls.leaderstats.Points.Value = ls.leaderstats.Points.Value + script.Parent.Value
val = val + 1
wait(0.5)
val = 0
end
end
end)
this script works, except i have to keep walking on and off the button, because of the fact it is waiting 0.5 seconds. i want it to repeat but im just not sure how i can accomplish that
also the part the script is on also has an intvalue which is used at the end of line 8
thanks 