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

Help fixing this code?

Asked by
StoIid 364 Moderation Voter
8 years ago
local model = game.Lighting.BanKatanas1:Clone() 

    model.Parent = game.Workspace
    model:MakeJoints()
    model:MoveTo(Vector3.new(0,0,0) * Torso.CFrame)
    wait(10)

I think the error is in the part where i assign the position. I do not know how to properly assign the position with Vector3 and CFrame. I want it to only be placed where the characters torso is, but the output shows an error saying it expects a Vector3.

0
Torso.CFrame.p GoldenPhysics 474 — 8y
0
Thank you! And what do i do if i want to change / add / tweak the position? Vector3.new and play around? StoIid 364 — 8y
0
Just change the numbers in the Vector3.new(0, 0, 0). Such as Vector3.new(5, 0, 0) to make it move positive 5 on the x axis. GoldenPhysics 474 — 8y
0
Gotcha. Also, when i do just "Torso.CFrame" It lines up perfectly with my players torso. But when I do CFrame.p it makes it so only one part is where my torso actually is. StoIid 364 — 8y
View all comments (2 more)
0
Then edit the model's primaryPart CFrame. GoldenPhysics 474 — 8y
0
How would we do this? MoveTo(primaryPartCFrame * Torso.CFrame.p)? StoIid 364 — 8y

Answer this question