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

How can I rotate the sword?

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

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)

2 comments

0

Btw HandlePart's parent is a model... So It says Grip is not a valid member of a model

0

Edited

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