I want to make a part go to the part of the player’s head, but it doesn’t seem to work?
Error :
Workspace.Kurtziru.CustomizationSystem:11: attempt to call a table value
Script :
local char = script.Parent
local player = game.Players:GetPlayerFromCharacter(char)
local stat = player:WaitForChild("Customization")
local folder = game.ReplicatedStorage.Customization
if stat.Hair.Value == 1 then
local model = folder.Hair.One:Clone()
char:WaitForChild("Hair"):Destroy()
model.Parent = char
model.Position = char.Head.Position + Vector3(0, 0.2, -0.2)
model.Name = "Hair"
end
You typed Vector3, you need Vector3.new. You forgot the new bit.
Also if you highlight the exact line, people won’t miss the error or end up counting lines manually.
Kinda like this
char:WaitForChild("Hair"):Destroy()
model.Parent = char
-- THE LINE UNDER THIS HAS AN ERROR
model.Position = char.Head.Position + Vector3(0, 0.2, -0.2)
--
model.Name = "Hair"