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

[SOLVED]attempt to call method 'Kick' (a nil value)?

Asked by 5 years ago
Edited 5 years ago

I am trying to make an admin panel, so when I type the name and reason and click the Kick button, The script gets the player from the text and kicks him I tried this script but I get the error in the title

localscript:

local Username = script.Parent.Parent.Username
local Reason = script.Parent.Parent.Reason
script.Parent.MouseButton1Click:Connect(function()
local v = game.Players.LocalPlayer
for i,v in pairs(game.Players:GetPlayers()) do
local name = Username
name.Text:Kick(Reason.Text)
end
end)

Tree:

CommandPanel(Gui)
  Background(Frame)
  Username(TextBox)
  Reason(TextBox)
  Kick(TextButton)
    Kick(LocalScript)
0
Where is the script located at? ieatandisbaconhair 77 — 5y
0
Inside of the Kick button. Username is a child of the Gui aswell as the reason and kick button mixgingengerina10 223 — 5y
0
You are trying to kick a player from localscript, you're overriding "v", this is not FE compatible Axdrei 107 — 5y
0
Oh well, I fixed it. mixgingengerina10 223 — 5y

Answer this question