Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Head is not a valid member of Model "Workspace.(username)", what do I do?

What do I do? When I try naming myself using adonis admin it kills me when it shows that message.

local groupid = 5814603
local rep = game:GetService("ServerStorage")	
local nametag = rep.NameTag


game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		local head = char.Head	
		local newtext = nametag:Clone()
		local uppertext = newtext.UpperText
		local lowertext = newtext.LowerText
		local PlayerRank = player:GetRoleInGroup(groupid)
		local humanoid = char.Humanoid
		humanoid.DisplayDistanceType = "None"


		newtext.Parent = head
		newtext.Adornee = head
		uppertext.Text = player.Name
		lowertext.Text = PlayerRank
		lowertext.TextColor3 = Color3.fromRGB(46, 255, 255)
	end)
end)

This is my name GUI script. If you know what's wrong that'd be great.

P.S - I'm not asking for a solution that changes the name in the script, all I want it is so that if you try naming using adonis admin you don't get killed! Some people may accidentally use the command so I'd like to fix it, thank you!

1 comment

0

The GUI works, it just kills you when you try using the name command which people might accidentally use.

1 answer

Try

local head = char:WaitForChild("Head") 

let me know if that worked.

1 comment

0

Really sorry for late reply, nope it didn't work!

This discussion is preserved as it was. New answers, comments, and votes are closed.