Scripting help needed

Could anyone help me with a thing?
Basically if a player joins the games and waits 15 seconds he gets automatically kicked.
I really don’t wanna ask for scripts but I just can’t find a solution for this.

Do you mean when they’re AFK for 15 seconds they get kicked?

No just join it’s kinda weird yeah xd im making an myth game

game.Players.PlayerAdded:Connect(function(player)
    task.wait(15)
    player:Kick("You've been kicked")
end)

Try this - create a Script and place is in ServerScriptService. with the following code:

local Players = game:GetService("Players")
local timeToKick = 15 -- time until the player gets kicked
local reason = "You have been kicked!" -- change this to the message that shows up when the player is kicked
Players.PlayerAdded:Connect(function(Player)
	wait (timeToKick)
	Player:Kick(reason)
end)

Let me know if you have any errors

1 Like

Thank you so much it worked for me!

1 Like

Happy to help! Let me know if you have any other problems.

1 Like

task.wait would be better here

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.