Can you clearly tell me what to do in order cause this topic really is a chaos right now.
I donât know how your exact model hierarchy is, so I canât essentially type a script that you just plug it in and it works. It seems that you have a bit of tinkering with CFrames to do especially the attachments ones. I could help you with it if you send me a copy of the animation and sword model though. (You can dm me on Discord: temrer1247 or just dm me here, however you like more) hope this helps
Iâve got a definitive solution a while ago, sorry for not replying. Still up?
Yes the problem is still there do you mind tell me the solution?
Alright, so if you or anyone is still wondering whatâs the solution iâll post it here.
First of all, delete both this LocalScript that requires the ModuleScript and the ModuleScript.
Now, we will start everything from the very beggining.
Some Explanation
I did a simple tool here in a completely blank Baseplate map to show you what happens when you just name the Grip (Blue Square) as âHandleâ.
As you can see, when you name a Part as âHandleâ in a tool Roblox automatically creates a Weld instance inside the Characterâs RightHand to attach it to the player and also runs the default tool animation. To fix that, first we need to make sure the âRequiresHandleâ option of the tool is DISABLED. What it does is basically allow you to create a Tool with or without the âHandleâ BasePart. And then we rename the âHandleâ Part to anything but âHandleâ, so you can rename it to âToolGripâ (Do not rename it to âGripâ). Also, the big part is at the ground because i didnât Welded the ToolGrip to it.
Solution
1. Welding the "Handle" to the Sword's Model
What i recommend you to do here is, if you have only a single part/Mesh as the swordâs model, make a âMotor6Dâ instance to weld them cause the parts will remain at the same place. If you have a whole model to Weld, you can perfectly use Welds for every modelâs part. You can have the help of some plugin if thereâs too many parts. BUT the Part0 of all the Welds needs to be the âToolGripâ, this is very important, also if youâre going to use the Motor6D.
2. Creating the Custom Hold Animation
As you already saw at the first step, there is no toolâs default animation playing. So now we can freely put our custom animation in there. (Sorry, but i will not explain how to make an animation)
I made this simple keyframe as the animation that only changes the Armâs positions, but if you want you can change the swordâs position with a new Motor6D!
You know, Part0 is the Rigâs RightHand and the Part1 is the Swordâs ToolGrip just like we will make at the scripting step.
Donât forget to Change the animationâs Priority to Action or above! Now you just publish it to Roblox (Also not showing this).
3. Loading the animation and Scripting (END)
Finally, we will load the animation when the Character equips the tool. Not something too complicated, so letâs script:
- Copy the ID of the custom animation
- Make an Animation instance and put it inside a folder named âAnimationsâ to make it organized.
- Paste the animationâs ID at the area i mentioned at the image. You donât need to add the base URL, just paste the ID and it will put the URL automatically.
- Create a RemoteEvent instance in your tool
- Paste the following scripts:
LocalScript:
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local tool = script.Parent
local EquipRemote = tool:WaitForChild("EquipRemote")
local Animation = tool.Animations.Animation
local AnimationLoad = animator:LoadAnimation(Animation)
tool.Equipped:Connect(function()
AnimationLoad.Priority = Enum.AnimationPriority.Action
AnimationLoad.Looped = true
AnimationLoad:Play()
EquipRemote:FireServer()
end)
tool.Unequipped:Connect(function()
AnimationLoad:Stop()
end)
Script:
local tool = script.Parent
local EquipRemote = tool:WaitForChild("EquipRemote")
EquipRemote.OnServerEvent:Connect(function(player)
local M6D = tool:WaitForChild("Motor6D")
M6D.Part0 = player.Character:WaitForChild("RightHand")
M6D.Part1 = tool.ToolGrip
end)
DONâT FORGET TO CHANGE THE SCRIPTâS LOGIC BASED ON THE INSTANCEâS NAMES AND WHERE YOU PUT THEM!
If you did everything correctly, you should be done. Thatâs it. Hope this helped! Results:
Also replicating to the server
I did everything exactly how you said it:
But it did not worked
here is a vid:
robloxapp-20230706-2005132.wmv (419.4 KB)
And here is my explorer with everything unfolded:
Nothing at the output? If there is nothing, then there is something else at probably your animations keyframes or there is some script at probably StarterCharacterScripts that is making the animation like that. You can see that the custom animation is playing, so my system is working. Check your animation first. Even if you didnât changed the position of the lowertorso nor the uppertorso, roblox will count it as static if there is a keyframe. Look at the pictures i sent you:
As you can see, when i moved the ToolGrip a keyframe was automatically created. Even if i put it back at the same position from before the Keyframe will remain there. This also happens with the RightUpperArm and the RightLowerArm, it remains static when you equip the tool as you can see. This means that if you made a Keyframe with the LowerTorso and your UpperTorso at the animation it will remain static cause this is the keyframe you made.
I also recommend you to make a Motor6D when remake the animation and put the weapon at the correct side.
You just have to add a local script so you can change the CFrame of the sword
it will look something like this:
Motor6D.C1 = Motor6D.C1 * CFrame.Angles(math.pi/2, 0, 0) * CFrame.new(0,.2,0)
--the CFrame.Angles will rotate the sword
--and the last CFrame will offset the sword so that it
--won't clip in the player's hands
Hope this helps
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.