Attempt to call a table value

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

Help would be appreciated thank you!

Is this your full script? If not, I don’t see anything wrong.

Yeah it is, It results in that error though I dont know why

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

The line that errors:

	model.Position = char.Head.Position + Vector3(0, 0.2, -0.2)

Or 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"
3 Likes

Oh sorry!, I didn’t realise that my bad thank you!