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

I tried to make a kick pannel?

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

✓ Accepted answer

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)

2 comments

0

Checking it out..

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)

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