nate890Join Date: 2008-11-22 Post Count: 21686 |
function Click(mouse)
local find = script.Parent.Parent.TextBox.Text.Players:findFirstChild
if find ~= nil then
find:remove()
end
end
script.Parent.MouseButton1Down:connect(Click) |
|
|
local find = script.Parent.Parent.TextBox.Text.Players:findFirstChild
Messed up there. Try this
local find = script.Parent.Parent.TextBox.Text.Players:findFirstChild("Objectname")
|
|
nate890Join Date: 2008-11-22 Post Count: 21686 |
Didnt work
Players.Player.PlayerGui.GuiMain.TextButton.Script:2: attempt to index field 'Players' (a nil value) |
|
nate890Join Date: 2008-11-22 Post Count: 21686 |
Would this work on solo, if I were to type my own name "player"? |
|
nate890Join Date: 2008-11-22 Post Count: 21686 |
Bump
function Click(mouse)
local find = script.Parent.Parent.TextBox.Text.Players
if find ~= nil then
find:remove()
end
end
script.Parent.MouseButton1Down:connect(Click)
|
|
nate890Join Date: 2008-11-22 Post Count: 21686 |
bump |
|
|
What do you want the script to do? That is what you should have told from the start. |
|
|
Is it an admin ability that you can use to kick people from the game? |
|
nate890Join Date: 2008-11-22 Post Count: 21686 |
Its a text box, you type in a players name in the text box, then you click the button (the textbox doesnt include the script) the textbutton does, afdter you press the button it finds the players name thst you typed in then kickes him |
|
drummerpJoin Date: 2009-01-10 Post Count: 4892 |
Not sure you can use the remove function on a Player object, but try this:
function Click(mouse)
local playername = script.Parent.Parent.TextBox.Text
local player = game.Player:findFirstChild(playername)
if player ~= nil then
player:remove()
end
end
script.Parent.MouseButton1Down:connect(Click)
|
|
FoodTestsJoin Date: 2009-05-02 Post Count: 1507 |
On line 3 it is game.Players(with an S). |
|
|
function OnButtonDown()
e = script.Parent.Parent.TextBox.Text
g = game.Players:GetChildren()
for i = 1, #g do
if string.lower(g[i].Name) == e then
g[i]:Remove()
end
end
end
script.Parent.MouseButton1Click:connect(OnButtonDown) |
|
|
TextBox GUIs don't have Capitals. Names do. Just so you know. |
|
nate890Join Date: 2008-11-22 Post Count: 21686 |
Do you think it would work in solo? and it didnt work...
output:
Sun Nov 08 02:14:25 2009 - Player is not a valid member of DataModel
Sun Nov 08 02:14:25 2009 - Players.Player.PlayerGui.GuiMain.TextButton.Script, line 3 stack end |
|
bloccoJoin Date: 2008-08-14 Post Count: 29474 |
It's game.Players |
|
|
Mine works. I copied it outof my Admin controls. |
|
nate890Join Date: 2008-11-22 Post Count: 21686 |
I dont think caps matter |
|
|
Fine then, you think that. Have fun~ |
|
bloccoJoin Date: 2008-08-14 Post Count: 29474 |
@nate:
LISTEN TO MY POST... I POSTED IT FOR A REASON.
caps... :P |
|
nate890Join Date: 2008-11-22 Post Count: 21686 |
It works rlr thx, caps dont matter |
|
drummerpJoin Date: 2009-01-10 Post Count: 4892 |
I just accidentally misspelled "Players" (forgot the s). Try this:
function Click(mouse)
local playername = script.Parent.Parent.TextBox.Text
local player = game.Players:findFirstChild(playername)
if player ~= nil then
player:remove()
end
end
script.Parent.MouseButton1Down:connect(Click) |
|
nate890Join Date: 2008-11-22 Post Count: 21686 |
rpr's works, that one doesnt |
|
|
@Nate, If my name is RightLegRed, and I tried to kick rightlegred it wouldn't work.
CAPS DO MATTER. |
|
drummerpJoin Date: 2009-01-10 Post Count: 4892 |
What's the output on mine? |
|
|
@Drummer, why are you still trying if he already has a fixed one? |
|