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

How can I rotate the sword?

Asked by
Kolyolu -5
5 years ago

I am trying to rotate a sword 90 degrees but its not working somehow help?


local HandlePart = CreatePart(3, Weapon, "SmoothPlastic", 0, 0, "Really black", "Handle", VT(0, 0, 0), CF(-90, 0, 0)) local HandleMesh = CreateMesh("SpecialMesh", HandlePart, "FileMesh", "11442510", "11442524", VT(3,3,3), VT(0, 3.1 * Player_Size, 0)) local HandleWeld = CreateWeldOrSnapOrMotor("Weld", HandlePart, Torso, HandlePart, CF(2 * Player_Size, 2 * Player_Size, 0.6 * Player_Size) * ANGLES(RAD(0), RAD(0), RAD(135)), CF(0, 0, 0))

1 answer

Log in to vote
0
Answered by
mattscy 3725 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

You are able to edit the Grip property of tools to rotate the way characters hold them. To do this, you can insert a script inside the tool that goes something like this:

script.Parent.Grip = script.Parent.Grip * CFrame.Angles(math.rad(90),0,0)

You may have to change the axis that you rotate it on or the direction it is rotated in, that is just an example.

If it is not a traditional tool, and you are just welding it instead, you can apply the same technique to rotate the weld. For example:

weld.C1 = weld.C1 * CFrame.Angles(math.rad(90),0,0)
0
Btw HandlePart's parent is a model... So It says Grip is not a valid member of a model Kolyolu -5 — 5y
0
Edited mattscy 3725 — 5y
Ad

Answer this question