01 | chr = workspace.supercoolguy 53 |
02 | mouse = game.Players.LocalPlayer:GetMouse() |
04 | part = Instance.new( "Part" ,chr) |
05 | part.CanCollide = false |
07 | part.BrickColor = BrickColor.White() |
09 | part.Size = Vector 3. new( 7 , 7 , 7 ) |
10 | mesh = Instance.new( "SpecialMesh" ,part) |
11 | mesh.MeshType = "Sphere" |
13 | part.Touched:connect( function (p) |
14 | local h = p.Parent:FindFirstChild( "Humanoid" ) |
15 | if h and h.Parent.Name ~ = "supercoolguy53" then |
20 | mouse.KeyDown:connect( function (key) |
23 | local clone = part:clone() |
26 | clone.CFrame = CFrame.new(chr.Head.Position + (chr.Head.CFrame.lookVector* 1 ), mouse.Hit.p) |
29 | game:GetService( 'RunService' ).RenderStepped:wait() |
30 | chr.part 1. CFrame = CFrame.new(chr.Position + (chr.part 1. CFrame.lookVector*. 1 )) |
35 | while game:GetService( 'RunService' ).RenderStepped:wait() do |
36 | part.CFrame = chr.Torso.CFrame |
You forgot the fact that CFrame
is a global variable, and that the CFrames
of bricks do not contain constructors to create more CFrames
. You must use CFrame
, not BasePart.CoordinateFrame
.
Basically:
1 | local part = Instance.new( 'Part' , workspace) |
2 | part.CFrame = part.CFrame.new( 0 , 5 , 0 ) |
3 | part.CFrame = CFrame.new( 0 , 5 , 0 ) |
I hope I helped, if you have any questions, contact me.