local tool = script.Parent
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
local fireEvent = tool:WaitForChild("FireEvent")
local reloadEvent = tool:WaitForChild("ReloadEvent")
local equipped = false
local userInputService = game:GetService("UserInputService")
local db = false
local humanoid
local idle
tool.Activated:Connect(function()
if db == false then
local mousePosition = mouse.Hit.Position
fireEvent:FireServer(mousePosition)
db = true
wait(.5)
db = false
end
end)
tool.Equipped:Connect(function()
equipped = true
humanoid = tool.Parent:FindFirstChild("Humanoid")
idle = humanoid:LoadAnimation(script.Parent.Idle)
idle.Looped = true
idle:Play()
end)
tool.Unequipped:Connect(function()
equipped = false
idle:Stop()
end)
Seemingly, you’ve done a few slight errors You must change the AnimationPriority to anything other than Core in the animations menu, and publish it again, and don’t fonrget to change the AnimationId in your script according to the new animation.
I think this is also caused by the default tool animations overwriting your custom animations.
And that’s where the complicated part begins.
While in game, open the Explorer tab and get inside your character.
Copy the script called Animate
Leave the game and place it in StarterCharacterScripts.
Scroll until you find this line:
function animateTool()
if (toolAnim == "None") then
playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
return
end
if (toolAnim == "Slash") then
playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
return
end
if (toolAnim == "Lunge") then
playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
return
end
end
Change it like this:
function animateTool()
if (toolAnim == "None") then
-- playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
return
end
if (toolAnim == "Slash") then
-- playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
return
end
if (toolAnim == "Lunge") then
-- playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
return
end
end
I changed the code of the Animate script and put it in the StarterCharacterScripts. https://gyazo.com/75d8f77a45b57f0d92561138a4541fb5
That is what I see.
The issue is, ALL OF MY LIMBS move when I move as if it’s the default walking animation.
My entire body is angled now though which I guess is progress.
So I ended up just changing the animations from Action 3 to Action 4 and it seemed to work, but all of my gunshots come from the bottom of the gun, so I’m assuming I have to work on making the animations replicated to the server now.