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

Player Entered/Leave script not working?

Asked by
TrollD3 105
9 years ago

This script is supposed to add a textbutton with the name of the player who joined inside it. It also has a script for when the player leaves so it can destroy the textbutton. But I dont think I did it well at all. The basic idea is there though.


for _, v in pairs (game.Players:GetChildren()) do Players= 0 local Players2 = Players v:WaitForChild("StarterGear") v.StarterGear:WaitForChild("Stats") v.StarterGear.Stats:WaitForChild("ClanTag") script:WaitForChild("Base") local Player3 = script.Parent.Parent:clone() Player3.Position = Player3.Position + UDim2.new(0,0,0,Players2*29) Player3.Visible = true Player3.Parent = script.Parent Player3.Name = "Player" Player3.Text = v.Name
0
Are these textbuttons in a surfacegui or screengui? And is it a script or localscript? Is filteringEnabled true? GoldenPhysics 474 — 9y
0
ScreenGui and script. Filtering enabled isnt on. TrollD3 105 — 9y
0
If the script is ultimately inside the player, then you should be using a localscript. You might need to have some server code (normal script in the scriptservice) to make the list of everyone in the server, and some client code( localscript in the player) to position all the textbuttons correctly for that player. GoldenPhysics 474 — 9y

Answer this question