Problem with a ranktag script

Hi guys, I am mebest2324. A relatively new scripter to the market and I was working on an brand new ranktag script.

It is pretty simple but so far, I made 2 texts. One for the rank the player has, and another one for the team the player is in.

Although it isnt working, and on a really weird level too. Basically, the billboard gui does get copied to the head, but doesnt change its text. Which is definitely not what I want to see.
image

This is my script and I really appreciate any help, as I got stuck on this for a few days.

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if player:GetRankInGroup(15267987)> 250 then
			script.BillboardGui:Clone().Rank.Text = player:GetRoleInGroup(15267987)
			script.BillboardGui:Clone().Division.Text = "Administration"
			script.BillboardGui:Clone().Parent = character:FindFirstChild("Head")
			player.Team = game.Teams.Administration
		
		end


	end)
end)

Thank you, and as always. Any help is appreciated!

You are cloning and changing in the clone which wont affect the actual one, try this instead

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if player:GetRankInGroup(15267987)> 250 then

			local BillboardGui = script.BillboardGui:Clone()
			BillboardGui.Rank.Text = player:GetRoleInGroup(15267987)
			BillboardGui.Division.Text = "Administration"
			BillboardGui.Parent = character:FindFirstChild("Head")
			player.Team = game.Teams.Administration
		
		end
	end)
end)
1 Like

Try adding a variable for the GUI.


game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if player:GetRankInGroup(15267987)> 250 then
local BillboardGui = script.BillboardGui:Clone()	
	BillboardGui.Rank.Text = player:GetRoleInGroup(15267987)
		BillboardGui.Division.Text = "Administration"
		BillboardGui.Parent = character:FindFirstChild("Head")
			player.Team = game.Teams.Administration
		
		end


	end)
end)

Edit: person above me did the same thing. Since your not defining it, the game thinks to clone another billboard gui each time you do that. To fix this, just define it with a variable so that the GUI can have all properties instead of just cloning each other

Oh, thanks. I will try it out immediately.

1 Like

I will try this out immediately, thanks for helping!

1 Like

It worked, people like you make my life tollerable. Thanks!

Note: You forgot to add an end for the characteradded function although, I fixed it!

This also worked, thank you for your time.

I had the end there? I used your code but changed the middle part, that’s it, mark it as a solution so no more people come to it.

Oh, I meant like you forgot to add an end) at the end of the script.

I did not? You maybe copied it wrong? You can check my code

Anyways mark it as a solution so people dont come and try to help when its already solved.

1 Like

Check my code thats up it has 3 ends, it wont matter tho, it worked which is the important part.

1 Like

WAIT! I USED THE OTHER GUYS CODE SO SORRY! I am really really really sorry.

2 Likes

No problem! Mistakes always happen

2 Likes

Alright, thank you for your time. It works.

Your welcome, glad i was able to help!

2 Likes