Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[Answerd by myself] Why isn't my admin script working!? There are no errors. Please help!.

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.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.