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

How to Spawn block on player head?

local plr = game.Players.LocalPlayer
block = Instance.new("Part")
block.CFrame = CFrame.new(plr.Character.Head.Position)
--yes

5 comments

0

fix plz

0

What do you mean by spawn block?

0

Spawn a part

0

On a players head?

0

your nearly there, just add on line 3 + Vector3(0, 3, 0) -- Change y position

1 answer

You were pretty close, but block.CFrame = CFrame.new(plr.Character.Head.Position) doesn't work because those are two incompatible values. Instead all you have to do is take the X, Y, and Z values of the head and use those instead.

Also, when spawning something using Instance.new don't forget to set its Parent!

local plr = game.Players.LocalPlayer
block = Instance.new("Part")
block.Parent = game.Workspace
block.CFrame = CFrame.new(plr.Character.Head.Position.X, plr.Character.Head.Position.Y, plr.Character.Head.Position.Z)

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