Help me script a kick system

Im trying to make a kick system based on placeid

my work:

if game.PlaceId == "6666943197" then
print("confirmed")
else
game.Players.LocalPlayer:Kick("unconfirmed")
end

it has no error but it does not work

1 Like

What type of script is this and where is it located? Also PlaceId returns a number, so remove the quotation marks between "6666943197"

1 Like

Try this:

if game.PlaceId == 6666943197 then
print("confirmed")
else
game.Players.LocalPlayer:Kick("unconfirmed")
end

PlaceId is a number, not a string, meaning PlaceId will never be “6666943197”

still not working script on workspace

1 Like

it is a script on workspace and

i made it without it but still

1 Like

If you’re using a local script then put it inside a playerscripts, also local player doesn’t work on normal scripts, if it’s a normal script then copy this code, create a localscript in playerscripts and paste it. (You can also use a normal script and use the PlayerAdded event to manage joins and kicks.)

1 Like

Localscripts do not work in workspace, put it somewhere to where it can work, suchas StarterPlayerScripts

1 Like

Ah! I’m assuming it’s a ServerScript then, try this:

game.Players.PlayerAdded:Connect(function(player)
if game.PlaceId == 6666943197 then
print("confirmed")
else
player:Kick("unconfirmed")
end
end)

Edit: Yay! My first dev fourm solution!

2 Likes