So I want to make a admin script, but the kick command doesn't work.
Code (server) :
local remoteEvent = game.ReplicatedStorage:WaitForChild("Admin") remoteEvent.OnServerEvent:Connect(function(action, target) print("1") if action == "Kick" then print("Kicking..") print(target) print(action) game.Players[target]:Kick() print("Target Kicked") end end)
Code (local) :
local remoteEvent = game.ReplicatedStorage:WaitForChild("Admin") local targetPlayer = script.Parent.TextLabel.Text -------------------------------Kick------------------------------- local kickBtn = script.Parent.Kick kickBtn.MouseButton1Up:Connect(function() remoteEvent:FireServer("Kick", targetPlayer) end)
Output: 1
If you have any questios ask me in the comments.
I found out the answer.