|
| 22 Sep 2017 10:36 AM |
So here's what I have so far :
wait(1) for i,v in pairs(game.Players:GetChildren()) do local o = Instance.new("TextButton") o.Parent = v.PlayerGui.ScreenGui.Frame o.Name = i..v.Name.."'s nametag" o.Text = i..". "..v.Name o.BorderSizePixel = 0 o.Position = UDim2.new(0, 0, 0.216, 0) o.Size = UDim2.new(0, 290, 0, 50) o.TextScaled = true o.MouseButton1Down:connect(function() v.Character.Humanoid.Health = 0 end) end
So, it's making the new button, but only for the local player. So there is only one button being made, even when there are multiple players in the server. I need it so that once a player joins there will be a new button with the same function, in a new position(preferably under the first players button). Any help is much appreciated! |
|
|
| Report Abuse |
|
|
|
| 22 Sep 2017 10:41 AM |
either
Game.Players.PlayerAdded:connect(function(player)
end)
or
workspace.ChildAdded:connect(function(child) if game.Players:GetPlayerFromCharacter(child) then end end)
tbh i never worked out the different of the outcome of the two |
|
|
| Report Abuse |
|
|
|
| 22 Sep 2017 10:45 AM |
forgot a few things lol make a list of all the buttons
local ButtonList = {}
every time a player is added and the button is made
ButtonList[#ButtonList] = Button
then for the next button
local ButtonPos = (50 * ToNumber(#ButtonList)) + 5 * (ToNumber(#ButtonList))
idk really im just thinking |
|
|
| Report Abuse |
|
|
|
| 22 Sep 2017 10:49 AM |
Trying to put this together right now.
seems difficult e.e |
|
|
| Report Abuse |
|
|
|
| 22 Sep 2017 10:55 AM |
| Only takes an hour or two don't worry |
|
|
| Report Abuse |
|
|
|
| 22 Sep 2017 11:01 AM |
| It's saying : PlayerGui is not a valid member of Player. I've also put a wait, but this still persists. |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Sep 2017 11:05 AM |
| Why am I making this harder than it is. I suck at scripting lol |
|
|
| Report Abuse |
|
|
|
| 22 Sep 2017 11:08 AM |
should be a simple error in your hierarchy spelling FIND IT OR FACE THE WRATH OF THE OUTPUT BAR |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Sep 2017 11:24 AM |
| the problem is that it isn't making a button for each player skreee i'm so frustrated |
|
|
| Report Abuse |
|
|