Hello!
I tried adjusting a script that I found to fit my needs, but I don't know how to make it work. I'd like to make it so, depending on the players team, the different ID would be used.
For example, if the player is on the Bright yellow team, he'd have the "clothingstoreid" used and displayed above his head, but if he's on the Bright blue team, he'd have the "officeid" id used.
How would I do this? The place is filtering enabled.
Thanks in advance!
clothingstoreid = 3324859 --Write your group's id right here, you don't need to worry about anything else, unless you plan on changing colors.
officeid = 2989165
familyid = 0
restuarantid = 0
game.Players.PlayerAdded:connect(onPlayerRespawned) --Connection for the function right below.
function onPlayerRespawned(newPlayer) --When a player joins the "Players" service.
wait(1) --Obviously waits to start the script
if newPlayer then --Just checking if the player exist.
gui=Instance.new("BillboardGui") --Creating a new BillboardGui
gui.Parent=newPlayer.Character.Head --Inserting the BillboardGui into the player.
gui.Adornee=newPlayer.Character.Head
gui.Size=UDim2.new(4,0,2,0) --Leave this one be.
gui.StudsOffset=Vector3.new(0,3,0) --Leave this one be.
texta=Instance.new("TextBox") --Creating a new TextBox
texta.Size=UDim2.new(1,0,1,0) --Leave this one be.
texta.BackgroundTransparency = 1 --1 Makes the background invisible, 0 will show it.
texta.Text = ("[ " .. newPlayer:GetRoleInGroup(clothingstoreid) .. " ]") --This changes the text to the rank in a group.
texta.TextColor3 = Color3.new(50,10,255) --This is the text color of non-group members.(50,10,255) is white; (0,2,44) is teal
texta.Parent=gui --Inserting the TextBox to the BillBoardGui
if newPlayer:IsInGroup(clothingstoreid) then --Checking if the player actually belongs to the group.
texta.TextColor3 = Color3.new(50,10,255) --This is the text color of group members.(0,0,128) is blue;(23/255,14/255,80/255) is dark purple
end
end
end
function onPlayerEntered(newPlayer)
newPlayer.Changed:connect(function (property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end)
end
game.Players.PlayerAdded:connect(onPlayerEntered)

5 comments
"Attempt to connect failed: Passed value is not a function" "attempt to call a nil value"
What line is that on?
Doesn't let me click on it.
Ok now try
There's no errors, but there's no Gui's either now.