Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I tried to make a kick pannel?

Asked by 5 years ago

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?

1local frame = script.Parent.Frame
2local kickbutton = script.Parent.KickButton
3 
4frame.kickbutton.MouseButton1Click(function()
5    if game.players:FindFirstChild(frame.player.Text)then
6        game.ReplicatedStorage.KickPlayer:FireServer(frame.player.text, frame.Reason.Text)
7    end
8end)

1 answer

Log in to vote
0
Answered by
OnaKat 444 Moderation Voter
5 years ago

Your wrong is on line 4

1frame.kickbutton.MouseButton1Click(function()

To run function use :Connect(function()

That all you need to change

Here is script

1local frame = script.Parent.Frame
2local kickbutton = script.Parent.KickButton
3 
4frame.kickbutton.MouseButton1Click:Connect(function()
5    if game.players:FindFirstChild(frame.player.Text)then
6        game.ReplicatedStorage.KickPlayer:FireServer(frame.player.text, frame.Reason.Text)
7    end
8end)
0
Checking it out.. fortesss7 40 — 5y
0
Should be like this ? local frame = script.Parent.Frame local kickbutton = script.Parent.KickButton local text = script.Parent.Frame["Player-Box"] local Reason = script.Parent.Frame["Reason-Box"] frame.kickbutton.MouseButton1Click(function() if game.players:FindFirstChild(frame.player.Text)then game.ReplicatedStorage.KickPlayer:FireServer(frame.player.text, frame.Reason.Text) fortesss7 40 — 5y
Ad

Answer this question