I just made a kick script, and nothing happened in output and it didn't kick me. (I said in the chat /e kick FrostedFlakes67). Here's the code, I hope someone can help.
game:GetService("Players").PlayerAdded:Connect(function(plr)
if plr.UserId == game.CreatorId then
plr.Chatted:Connect(function(msg)
local lowermsg = string.lower(msg)
local command = "/e kick "
if string.sub(lowermsg,1,#command) == command then
local PlayerToKick = string.sub(msg,#command,#lowermsg)
game:GetService("Players"):FindFirstChild(PlayerToKick):Kick("You have been kicked from the game by the game's owner.")
end
end)
end
end)

11 comments
Should I have used pcall?
i have no idea what pcall is so ill ignore that but ill looking...
maybe try game.Players Instead of getservice, usually works if you change that.
Pcall is like function, but instead of function, it does not stop if there is an error.
this should be in normal script in workspace by the way it looks like, try what i suggested plz
Let me change it to game.Players, but this is in ServerScriptService.
Just tried, It didn't work.
Um, i think iv done that once? if it doesnt work then put in workspace
Doing that.
Nope, doesn't work in workspace either.
OK im just gonna check this whole thing out closer now