Help me I am trying to fire a remote event when the owner of the tycoon hits the gamepass buttton however when i touched it, it keeps on firing even I added a debounce.
local id = script.Parent.Parent.Gamepass.Value
local Owner = script.Parent.Parent.Parent.Parent.Owner
local RM1 = game.ReplicatedStorage.RemoteEvents.GamepassPurchaseButton
script.Parent.Touched:Connect(function(hit)
local debounce = false
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if script.Parent.CanCollide == true then
if player ~= nil then
if Owner.Value == player then
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Humanoid.Health > 0 then
if not debounce then
RM1:FireClient(player)
wait(10)
debounce = false
end
end
end
end
end
end
end)

1 comment
Did not notice it thank you