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 4 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?

local frame = script.Parent.Frame
local kickbutton = script.Parent.KickButton

frame.kickbutton.MouseButton1Click(function()
    if game.players:FindFirstChild(frame.player.Text)then
        game.ReplicatedStorage.KickPlayer:FireServer(frame.player.text, frame.Reason.Text)
    end
end)

1 answer

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

Your wrong is on line 4

frame.kickbutton.MouseButton1Click(function()

To run function use :Connect(function()

That all you need to change

Here is script

local frame = script.Parent.Frame
local kickbutton = script.Parent.KickButton

frame.kickbutton.MouseButton1Click:Connect(function()
    if game.players:FindFirstChild(frame.player.Text)then
        game.ReplicatedStorage.KickPlayer:FireServer(frame.player.text, frame.Reason.Text)
    end
end)
0
Checking it out.. fortesss7 40 — 4y
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 — 4y
Ad

Answer this question