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

Player script problem? (revised, no progress)

Asked by
TrollD3 105
9 years ago

I want to make this script create a textbutton each time a player enters and when they leave the button will be destroyed. Please help i have been on this same script for the past few days. I seriously need help with this.

A look at my explorer: http://gyazo.com/dc737ffcde271877b05b4d0f6e846c10

function edit(plr)
    for num,p in pairs(game:GetService("Players"):GetPlayers()) do
        for _,obj in pairs(script.Parent.Parent:GetChildren()) do
            if obj.Name == "Player" then
                obj:Destroy()
            end
        end
        local gui = script.Parent:clone()
        gui:ClearAllChildren()
        gui.Position = gui.Position + UDim2.new(0, 0, 0, (num-1)*50) 
        gui.Visible = true
        gui.Parent = script.Parent.Parent
        gui.Name = "Player"
        gui.Text = plr.Name
    end
end
game.Players.PlayerAdded:connect(edit)
game.Players.PlayerRemoving:connect(edit)
0
I made most the script :3 EzraNehemiah_TF2 3552 — 9y
0
^^ I k thanks a lot. It helps but doesnt work. lol TrollD3 105 — 9y
1
We don't know what the error is though ^_^ EzraNehemiah_TF2 3552 — 9y
0
IK^^ This problem is driving me nuts. Maybe someone should just do this for me. TrollD3 105 — 9y
0
Try using a xpcall function it should grab the error. MessorAdmin 598 — 9y

Answer this question