Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago
Edited 3 years ago

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!

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

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Try

local head = char:WaitForChild("Head") 

let me know if that worked.

0
Really sorry for late reply, nope it didn't work! NoodleEater2 0 — 3y
Ad

Answer this question