uh I need help with this script it is basically where it checks where the bool value is true i tried to put a while loop but i dont work, pls help, here is the code:
local hasQuest = script.Parent.HasQuest
local event = game.ReplicatedStorage.Events.NoQuest
script.Parent.Touched:Connect(function(hit)
while true do
wait(1)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
if hasQuest.Value == false then
event:FireClient(player)
else
script.Parent.CanCollide = false
wait(2)
script.Parent.CanCollide = true
end
end
end
end)

1 comment
debounce so that it doesnt spam whatever the remote event does