I already have a gui , kick button and frame. The frame composed of someone typing the name in a box, and under it there is a reason for why kicking. I put this in the gui, but it is noit working, any help?
1 | local frame = script.Parent.Frame |
2 | local kickbutton = script.Parent.KickButton |
3 |
4 | frame.kickbutton.MouseButton 1 Click( function () |
5 | if game.players:FindFirstChild(frame.player.Text) then |
6 | game.ReplicatedStorage.KickPlayer:FireServer(frame.player.text, frame.Reason.Text) |
7 | end |
8 | end ) |
Your wrong is on line 4
1 | frame.kickbutton.MouseButton 1 Click( function () |
To run function use :Connect(function()
That all you need to change
Here is script
1 | local frame = script.Parent.Frame |
2 | local kickbutton = script.Parent.KickButton |
3 |
4 | frame.kickbutton.MouseButton 1 Click:Connect( function () |
5 | if game.players:FindFirstChild(frame.player.Text) then |
6 | game.ReplicatedStorage.KickPlayer:FireServer(frame.player.text, frame.Reason.Text) |
7 | end |
8 | end ) |