Hello! I'm experimenting with scripting so I'm fairly new, and I wanted to create a button that can kick you from the server.
FateButton = workspace.killroom.KBcontrolpanel.KILLBUTTON
function death(gb,msg)
FateButton.Part.SurfaceGui.TextLabel.Text = (gb)
print(msg)
return
end
FateButton.SurfaceGui.TextButton.MouseButton1Click:Connect(function()
local plr = game.Players:FindFirstChild()
FateButton.SurfaceGui.Enabled = true
death("You clicked the kick button, you are now being kicked.","Kicking player..")
wait(3)
plr:Kick("Kicked because you pressed the kick button")
end)
The output says line 8 is wrong because "Argument 1 missing or nil." This is outside of my small circle of knowledge about Lua scripting, so if anyone knows about it, please help.

1 comment
Trying doing local player rather than doing FindFirstChild. As FFC looks for the first child with a specific name (Argument 1) if you did