Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Unable to cast Vector3 to CoordinateFrame?

Asked by
Oficcer_F 207 Moderation Voter
6 years ago

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.

01tool = script.Parent
02player = game.Players.LocalPlayer
03tool.RequiresHandle = false
04wait(5) --ignore please
05head = player.Character.Head
06stair = game.ReplicatedStorage.PreviewStair
07stair.PrimaryPart = stair.PrimaryPart
08tool.Equipped:Connect(function(mouse)
09local part = game.ReplicatedStorage.TestPart
10part.Parent = game.Workspace
11game:GetService("RunService").RenderStepped:Connect(function()
12stair:SetPrimaryPartCFrame(head.Position + head.CFrame.LookVector * 5---error at this line
13end)   
14end)

Thanks for help! Cheers.

1 answer

Log in to vote
0
Answered by
zValerian 108
6 years ago
Edited 6 years ago
01tool = script.Parent
02player = game.Players.LocalPlayer
03tool.RequiresHandle = false
04wait(5) --ignore please
05head = player.Character.Head
06stair = game.ReplicatedStorage.PreviewStair
07stair.PrimaryPart = stair.PrimaryPart
08tool.Equipped:Connect(function(mouse)
09local part = game.ReplicatedStorage.TestPart
10part.Parent = game.Workspace
11game:GetService("RunService").RenderStepped:Connect(function()
12stair:SetPrimaryPartCFrame(head.CFrame+ head.CFrame.LookVector * 5))
13 
14stair.Parent = workspace
15 
16  ---error at this line
17end)   
18end)

try that?

edit: FIXED IT

1
Dude... You gotta explain.......................... greatneil80 2647 — 6y
0
not rlly zValerian 108 — 6y
0
Doesnt work... greatneil80 can you help? Oficcer_F 207 — 6y
0
no he doesnt really help, he just complains zValerian 108 — 6y
Ad

Answer this question