inPart = false
local waitSec = 4
script.Parent.Touched:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if not inPart then
print(player.leaderstat.Multi.Value)
player.leaderstat.Multi.Value = 2
inPart = true
wait(waitSec)
inPart = true
end
end)
script.Parent.TouchEnded:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if inPart then
print('End')
wait(waitSec)
inPart = not inPart
player.leaderstat.Multi.Value = 1
end
end)
It looks how i need but not, if the player touched the part gives 1 time if touch ended the value reseting to the any number. but the script spam the console.