NameTag not working

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		
	
		local function typeWrite(textbox, text)
			for i=1,#text do
				textbox.Text = (text):sub(1, i)
				wait(0.1)
			end
		end
		
		local plrtag = script.NameGui:Clone()
		plrtag.Parent = char:WaitForChild('Head')
		plrtag.overhead.UserName.Text = string.upper(plr.Name)

		coroutine.wrap(function()
			while true do		
				for _, IntValue in pairs(script.SettingsContainer.Configuration.Groups:GetChildren()) do
			if IntValue:IsA("IntValue") then
						typeWrite(plrtag.overhead.Division, string.upper(plr:GetRoleInGroup(9536284)))
						wait(1)
						typeWrite(plrtag.overhead.Division, string.upper(IntValue.RegimentName.Value))
						wait(1)
						typeWrite(plrtag.overhead.Division, string.upper(plr:GetRoleInGroup(IntValue.Value)))
						
					end
				end
			end
		end)

	end)
end)

For some reason, the “Division” text won’t do anything.

1 Like

convert them to a string

tostring(string.upper(plr:GetRoleInGroup(9536284))))
tostring(string.upper(IntValue.RegimentName.Value)))
tostring(string.upper(plr:GetRoleInGroup(IntValue.Value))))
1 Like

Lemme test it, didn’t realise I could’ve used “Tostring”

1 Like

Stil didn’t work… I don’t know why.

change your typeWrite function to

local function typeWrite(textbox, text)
			for i=1,#text,1 do
				textbox.Text = string.sub(text,1,i)
				wait(0.1)
			end
		end

is there any error in the output?

Let me try it, I don’t ever get any errors.

Didn’t work. No errors too. I don’t know why.

add a print in the if statement and see if it prints

1 Like

Did not print. I see there’s an issue within thr typewrite

then that means there was no intvalue in the for i,v in paris loop

1 Like

image

did you add a print right here?

                      if IntValue:IsA("IntValue") then
                        print("yes") -- here
						typeWrite(plrtag.overhead.Division, string.upper(plr:GetRoleInGroup(9536284)))
						wait(1)
						typeWrite(plrtag.overhead.Division, string.upper(IntValue.RegimentName.Value))
						wait(1)
						typeWrite(plrtag.overhead.Division, string.upper(plr:GetRoleInGroup(IntValue.Value)))
						
					end

I’ll do that, didn’t know I had to add it there.

Nope, didn’t work. Didn’t print.

ru sure that the intvalue is an intvalue?

Yes. It is an intvalue. Checked for all

Change

coroutine.wrap

To

Spawn

Or

coroutine.create(coroutine.resume(

why are you using a while loop though?

So it repeats the typewrite. I want all people to see.