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

how to make if player added function in startergui ?

Asked by
mehssi 20
9 years ago

hi can you help me add a 'if player added' function to this script? I know it should be something like this but idk how it should be in startergui please help me game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Char)

01-- need help here
02local Torso = player.Character.Torso
03local BackGui = Instance.new("SurfaceGui",Torso)
04BackGui.Face = "Back"
05BackGui.CanvasSize = Vector2.new(100,100)
06local NameDisplay = Instance.new("TextLabel",BackGui)
07NameDisplay.Size = UDim2.new(0.6,0,0.6,0)
08NameDisplay.Position = UDim2.new(0.21,0,0.28,0)
09NameDisplay.BackgroundTransparency = 1
10NameDisplay.FontSize = 5
11NameDisplay.TextStrokeTransparency= 0
12NameDisplay.Text = player.hiddenstats.Jersey.Value
13NameDisplay.TextColor3=Color3.new(1,1,1)
14NameDisplay.TextScaled = true
15NameDisplay.TextWrapped = true
16 
17player.hiddenstats.Jersey.Changed:connect(function()
18    NameDisplay.Text = player.hiddenstats.Jersey.Value
19end)

1 answer

Log in to vote
1
Answered by
Kyokamii 133
9 years ago

it would be game.Players.PlayerAdded:connect(function(Player)) the other one you said will only activates IF the character loads.

Ad

Answer this question