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

Unable to cast Vector3 to CoordinateFrame?

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

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

4 comments

1

Dude... You gotta explain..........................

0

not rlly

0

Doesnt work... greatneil80 can you help?

0

no he doesnt really help, he just complains

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