I kinda know what it is, but how do I fix it.
Basically I want to make a model 5 studs in front of my character. I used primary part esc but, it doesnt work.
01 | tool = script.Parent |
02 | player = game.Players.LocalPlayer |
03 | tool.RequiresHandle = false |
04 | wait( 5 ) --ignore please |
05 | head = player.Character.Head |
06 | stair = game.ReplicatedStorage.PreviewStair |
07 | stair.PrimaryPart = stair.PrimaryPart |
08 | tool.Equipped:Connect( function (mouse) |
09 | local part = game.ReplicatedStorage.TestPart |
10 | part.Parent = game.Workspace |
11 | game:GetService( "RunService" ).RenderStepped:Connect( function () |
12 | stair:SetPrimaryPartCFrame(head.Position + head.CFrame.LookVector * 5 ) ---error at this line |
13 | end ) |
14 | end ) |
Thanks for help! Cheers.
01 | tool = script.Parent |
02 | player = game.Players.LocalPlayer |
03 | tool.RequiresHandle = false |
04 | wait( 5 ) --ignore please |
05 | head = player.Character.Head |
06 | stair = game.ReplicatedStorage.PreviewStair |
07 | stair.PrimaryPart = stair.PrimaryPart |
08 | tool.Equipped:Connect( function (mouse) |
09 | local part = game.ReplicatedStorage.TestPart |
10 | part.Parent = game.Workspace |
11 | game:GetService( "RunService" ).RenderStepped:Connect( function () |
12 | stair:SetPrimaryPartCFrame(head.CFrame+ head.CFrame.LookVector * 5 )) |
13 |
14 | stair.Parent = workspace |
15 |
16 | ---error at this line |
17 | end ) |
18 | end ) |
try that?
edit: FIXED IT