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.

tool = script.Parent
player = game.Players.LocalPlayer
tool.RequiresHandle = false
wait(5) --ignore please
head = player.Character.Head
stair = game.ReplicatedStorage.PreviewStair
stair.PrimaryPart = stair.PrimaryPart
tool.Equipped:Connect(function(mouse)
local part = game.ReplicatedStorage.TestPart
part.Parent = game.Workspace
game:GetService("RunService").RenderStepped:Connect(function()
stair:SetPrimaryPartCFrame(head.Position + head.CFrame.LookVector * 5)  ---error at this line
end)    
end)

Thanks for help! Cheers.

1 answer

Log in to vote
0
Answered by
zValerian 108
6 years ago
Edited 6 years ago
tool = script.Parent
player = game.Players.LocalPlayer
tool.RequiresHandle = false
wait(5) --ignore please
head = player.Character.Head
stair = game.ReplicatedStorage.PreviewStair
stair.PrimaryPart = stair.PrimaryPart
tool.Equipped:Connect(function(mouse)
local part = game.ReplicatedStorage.TestPart
part.Parent = game.Workspace
game:GetService("RunService").RenderStepped:Connect(function()
stair:SetPrimaryPartCFrame(head.CFrame+ head.CFrame.LookVector * 5))

stair.Parent = workspace

  ---error at this line
end)    
end)

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