Hello, scripters.
I have a weird issue. It is weird.
Here are some screenshots of what happens:
The script:
What is shows in game:
I don’t understand why it shows ASOC as my team when my team is TRADOC.
Hello, scripters.
I have a weird issue. It is weird.
Here are some screenshots of what happens:
The script:
What is shows in game:
I don’t understand why it shows ASOC as my team when my team is TRADOC.
Try doing
print(plr.Team.name)
and then
print(plr.Team)
I’m just saying this as I don’t have studio open right now to check but it might just need to be just Team, doubt it though.
Alright, I will try it.
I wonder if that would work.
Tried it, did not work unless I did something wrong.
Alright, I’ll open up studio and see if I can find anything that would fix the issue
Probably need to update the label after your team changes
Works just fine for me?
local player = game.Players.LocalPlayer
script.Parent.Text = player.Team.Name
Really?
Werid, Auto refreshing the character on spawn fixed it.
Is ASOC the default team when joining? If so, use Instance:GetPropertyChangedSignal()
(needs a string parameter which is the property of the instance, and returns a RBXScriptSignal/event) to track whenever a property changes. You could use it on Team
's Name
and inside the event, change the TextLabel
's text to the team’s name. Here’s the code:
-- please convert the 4 spaces to a tab if you are using indents
plr.Team:GetPropertyChangedSignal("name"):Connect(function(newValue)
bClone.TextLabel.Text = plr.Team.Name -- using newValue also works
end)
No need to, and no it is not. I already solved the issue as how @hell_ish said to update the character on join.
I’m assuming it was because you were only ever setting the value of the “Text” property of that TextLabel instance once using the name of the Team instance the player is initially assigned to instead of dynamically changing it whenever the player dies/changes team etc.