✓ Accepted answer
You used double
**
**, try to be carefull next time.
Okay so, the point here is that you can desactivate it in two ways.
Ill show first, wich is recommended:
Shutdown event listener.
local PlayerJoinedEvent = game:service('Players').PlayerAdded
PlayerJoinedEvent:connect(function(player)
if player.Name=="Roblox" then
end
end)
You would want to use:
disconnect()
PlayerJoinedEvent:disconnect()
or the classic laggy way: Variable Statements
local IsOn = true
game.Players.PlayerAdded:connect(function(player)
if isOn==true then
if player.Name == "Roblox" then
end end
end)
IsOn = false
Hope this helps! If not, tell full output. ~marcoantoniosantos3
2 comments
Using a variable as a debounce like that isn't laggy unless hundreds of functions each second are waiting like that.
Its 'laggy' in the meaning it will repeat and activate the event but doesn't run inside code of the if isOn==true then, if you understand me. ;)