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
10 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

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

Answer this question