Hey! So i made some custom sword animations for my game. They look completely fine in Moon Animator, but when im playing them inside of the game, they are… Toned down if thats the right word. I tried disabling the script for idle and walking animations but didnt help.
Video below:
Problem Video
I have a few codes regarding the animations. One is for usage, so attack animations, second one is for playing idle animations and third one is for changing the generalk walk animation, idk if that can be connected. here are the scripts:
Idle Animation Script: Local
local humanoid = nil
local char = nil
local player = nil
local rootPart = nil
local mouse = nil
local cam = workspace.CurrentCamera
local uis = game:GetService("UserInputService")
local idleAnim = nil
local flying = false
script.Parent.Equipped:Connect(function()
humanoid = script.Parent.Parent.Humanoid
player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
char = script.Parent.Parent
idleAnim = char:WaitForChild("Humanoid"):LoadAnimation(script:WaitForChild("IdleAnim"))
rootPart = script.Parent.Parent.HumanoidRootPart
mouse = player:GetMouse()
equipped = true
idleAnim:Play()
end)
script.Parent.Unequipped:Connect(function()
equipped = false
idleAnim:Stop()
end)
Sword Script: Server
--By The_Saver31 --Credits to him
--CONFIGURATION
local Turn = 1
local Damage = script.Parent.Config.Damage.Value
local HeavyDamage = script.Parent.Config.HeavyDamage.Value
local Cooldown = script.Parent.Config.Cooldown.Value
local stamCost = script.Parent.Config.StamCost.Value
local HeavyStamCost = script.Parent.Config.HeavyStamCost.Value
local stamDamage = script.Parent.Config.StamDamage.Value
local HeavyStamDamage = script.Parent.Config.HeavyStamDamage.Value
local uis = game:GetService("UserInputService")
local heavy = game.ReplicatedStorage.Heavy
-- Particles
local particle1 = script.Parent.Particles.Core
local particle2 = script.Parent.Particles.CoreMiniSparks
local particle3 = script.Parent.Particles.MiniSparks
local particle4 = script.Parent.Particles.Sparks
local sparklight = script.Parent.Particles.PointLight
--END
function light()
sparklight.Enabled = true
wait(0.02)
sparklight.Enabled = false
end
script.Parent.Equipped:Connect(function()
local SoundEffect = Instance.new("Sound")
SoundEffect.SoundId = "rbxassetid://608618332"
SoundEffect.Name = "DeathSoundEffect"
SoundEffect.Volume = 1
SoundEffect.PlaybackSpeed = 1
SoundEffect.SoundGroup = nil
SoundEffect.PlayOnRemove = false
SoundEffect.Looped = false
SoundEffect.RollOffMaxDistance = 10000
SoundEffect.RollOffMinDistance = 10
SoundEffect.TimePosition = 0
SoundEffect.Archivable = false
SoundEffect:Play()
end)
function swingSound()
local SoundEffect = Instance.new("Sound")
SoundEffect.SoundId = "rbxassetid://6241709963"
SoundEffect.Name = "DeathSoundEffect"
SoundEffect.Volume = 1
SoundEffect.PlaybackSpeed = 1
SoundEffect.SoundGroup = nil
SoundEffect.PlayOnRemove = false
SoundEffect.Looped = false
SoundEffect.RollOffMaxDistance = 10000
SoundEffect.RollOffMinDistance = 10
SoundEffect.TimePosition = 0
SoundEffect.Archivable = false
SoundEffect.Parent = script.Parent:WaitForChild("Handle")
SoundEffect:Play()
end
function HitSound(parent)
local SoundEffect = Instance.new("Sound")
SoundEffect.SoundId = "rbxassetid://5473058688"
SoundEffect.Name = "DeathSoundEffect"
SoundEffect.Volume = 1
SoundEffect.PlaybackSpeed = 1
SoundEffect.SoundGroup = nil
SoundEffect.PlayOnRemove = false
SoundEffect.Looped = false
SoundEffect.RollOffMaxDistance = 10000
SoundEffect.RollOffMinDistance = 10
SoundEffect.TimePosition = 0
SoundEffect.Archivable = false
SoundEffect.Parent = parent
SoundEffect:Play()
end
function StunSound(parent)
local SoundEffect = Instance.new("Sound")
SoundEffect.SoundId = "rbxassetid://9119746751"
SoundEffect.Name = "DeathSoundEffect"
SoundEffect.Volume = 1
SoundEffect.PlaybackSpeed = 1
SoundEffect.SoundGroup = nil
SoundEffect.PlayOnRemove = false
SoundEffect.Looped = false
SoundEffect.RollOffMaxDistance = 10000
SoundEffect.RollOffMinDistance = 10
SoundEffect.TimePosition = 0
SoundEffect.Archivable = false
SoundEffect.Parent = parent
SoundEffect:Play()
end
function BlockSound(parent)
local SoundEffect = Instance.new("Sound")
SoundEffect.SoundId = "rbxassetid://211059855"
SoundEffect.Name = "DeathSoundEffect"
SoundEffect.Volume = 1
SoundEffect.PlaybackSpeed = 1
SoundEffect.SoundGroup = nil
SoundEffect.PlayOnRemove = false
SoundEffect.Looped = false
SoundEffect.RollOffMaxDistance = 10000
SoundEffect.RollOffMinDistance = 10
SoundEffect.TimePosition = 0
SoundEffect.Archivable = false
SoundEffect.Parent = parent
SoundEffect:Play()
end
function Stamina()
script.Parent.Parent:WaitForChild("Stam").Value = script.Parent.Parent:WaitForChild("Stam").Value - script.Parent.Config.StamCost.Value
end
function HeavyStamina()
script.Parent.Parent:WaitForChild("Stam").Value = script.Parent.Parent:WaitForChild("Stam").Value - HeavyStamCost
end
heavy.OnServerEvent:Connect(function(PlayerName)
print("NAME NAME "..script.Parent.Parent.Name)
print("KUTAS: "..PlayerName.Name)
if PlayerName.Name == script.Parent.Parent.Name and script.Parent.Parent:WaitForChild("IsAttacking").Value == false and script.Parent.Parent:WaitForChild("IsBlocking").Value == false and script.Parent.Parent:WaitForChild("IsStunned").Value == false then
if script.Parent.Cooldown.Value == false and script.Parent.Parent:WaitForChild("Stam").Value >= HeavyStamCost and script.Parent.Parent:WaitForChild("IsAttacking").Value == false then
print("HEAVYYYYYYYYYYYYYYYYYYYYYY")
script.Parent.Config.Damage.Value = HeavyDamage
script.Parent.Config.StamCost.Value = HeavyStamCost
script.Parent.Config.StamDamage.Value = HeavyStamDamage
script.Parent.Cooldown.Value = true
script.Parent.CanDamage.Value = true
local Humanoid = script.Parent.Parent:WaitForChild("Humanoid")
local Anim5 = Humanoid:LoadAnimation(script.Parent.Attack5)
script.Parent.Parent:WaitForChild("IsAttacking").Value = true
Anim5:Play()
swingSound()
HeavyStamina()
Anim5.Stopped:wait(Cooldown)
script.Parent.CanDamage.Value = false
script.Parent.Cooldown.Value = false
script.Parent.Parent:WaitForChild("IsAttacking").Value = false
script.Parent.Config.Damage.Value = Damage
script.Parent.Config.StamCost.Value = stamCost
script.Parent.Config.StamDamage.Value = stamDamage
wait(0.1)
else
return
end
end
end)
script.Parent.Activated:Connect(function()
if script.Parent.Cooldown.Value == false and script.Parent.Parent:WaitForChild("IsBlocking").Value == false and script.Parent.Parent:WaitForChild("Stam").Value >= stamCost and script.Parent.Parent:WaitForChild("IsAttacking").Value == false and script.Parent.Parent:WaitForChild("IsStunned").Value == false and script.Parent.Parent:WaitForChild("IsParrying").Value == false then
script.Parent.Cooldown.Value = true
script.Parent.CanDamage.Value = true
local Humanoid = script.Parent.Parent.Humanoid
local Anim1 = Humanoid:LoadAnimation(script.Parent.Attack1)
local Anim2 = Humanoid:LoadAnimation(script.Parent.Attack2)
local Anim3 = Humanoid:LoadAnimation(script.Parent.Attack3)
local Anim4 = Humanoid:LoadAnimation(script.Parent.Attack4)
if Turn == 1 then
script.Parent.Parent:WaitForChild("IsAttacking").Value = true
Anim1:Play()
Turn = Turn +1
swingSound()
Stamina()
Anim1.Stopped:wait(Cooldown)
script.Parent.CanDamage.Value = false
script.Parent.Cooldown.Value = false
script.Parent.Parent:WaitForChild("IsAttacking").Value = false
elseif Turn == 2 then
script.Parent.Parent:WaitForChild("IsAttacking").Value = true
Anim2:Play()
Turn = Turn +1
swingSound()
Stamina()
Anim2.Stopped:Wait(Cooldown)
script.Parent.CanDamage.Value = false
script.Parent.Cooldown.Value = false
script.Parent.Parent:WaitForChild("IsAttacking").Value = false
elseif Turn == 3 then
script.Parent.Parent:WaitForChild("IsAttacking").Value = true
Anim3:Play()
Turn = Turn +1
swingSound()
Stamina()
Anim3.Stopped:Wait(Cooldown)
script.Parent.CanDamage.Value = false
script.Parent.Cooldown.Value = false
script.Parent.Parent:WaitForChild("IsAttacking").Value = false
elseif Turn == 4 then
script.Parent.Parent:WaitForChild("IsAttacking").Value = true
Anim4:Play()
Turn = 1
swingSound()
Stamina()
Anim4.Stopped:Wait(Cooldown)
script.Parent.CanDamage.Value = false
script.Parent.Cooldown.Value = false
script.Parent.Parent:WaitForChild("IsAttacking").Value = false
end
else
return
end
end)
script.Parent.Hitbox.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") and script.Parent.Parent:WaitForChild("IsAttacking").Value == true then
local Humanoid = Hit.Parent.Humanoid
local isBlocking = Humanoid.Parent:WaitForChild("IsBlocking")
local isParrying = Humanoid.Parent:WaitForChild("IsParrying")
local Armor = Humanoid.Parent:WaitForChild("Armor")
if script.Parent.CanDamage.Value == true and isBlocking.Value == false and isParrying.Value == false then
Humanoid:TakeDamage(script.Parent.Config.Damage.Value -(script.Parent.Config.Damage.Value * Armor.Value)/100 )
HitSound(Humanoid.Parent:WaitForChild("Head"))
Humanoid.Parent:WaitForChild("Killer").Value = script.Parent.Parent.Name
print(Humanoid.Health)
script.Parent.CanDamage.Value = false
else
if script.Parent.CanDamage.Value == true and isBlocking.Value == true and Humanoid.Parent:WaitForChild("Stam").Value > 5 and isParrying.Value == false then
Humanoid.Parent:WaitForChild("Stam").Value = Humanoid.Parent:WaitForChild("Stam").Value - script.Parent.Config.StamDamage .Value
particle3:Emit()
particle4:Emit()
BlockSound(Humanoid.Parent:WaitForChild("Head"))
script.Parent.CanDamage.Value = false
else
if script.Parent.CanDamage.Value == true and isBlocking.Value == true and Humanoid.Parent:WaitForChild("Stam").Value <= 5 and isParrying.Value == false then
Humanoid:TakeDamage(script.Parent.Config.Damage.Value -(script.Parent.Config.Damage.Value * Armor.Value)/100 )
Humanoid.Parent:WaitForChild("Killer").Value = script.Parent.Parent.Name
HitSound(Humanoid.Parent:WaitForChild("Head"))
Humanoid.Parent:WaitForChild("Head"):WaitForChild("StunIndic").Enabled = true
Humanoid.Parent:WaitForChild("IsStunned").Value = true
StunSound(Humanoid.Parent:WaitForChild("Head"))
print(Humanoid.Health)
script.Parent.CanDamage.Value = false
else
if script.Parent.CanDamage.Value == true and isBlocking.Value == false and isParrying.Value == true then
script.Parent.Parent:WaitForChild("Head"):WaitForChild("StunIndic").Enabled = true
particle3:Emit()
particle4:Emit()
script.Parent.Parent:WaitForChild("IsStunned").Value = true
StunSound(Humanoid.Parent:WaitForChild("Head"))
return
end
end end end
return
end
end)
General Walk Animation Script: Server
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
while true do
char.Animate.run.RunAnim.AnimationId = "rbxassetid://15667991847"
wait(0.5)
end
end)
end)
Could the problem be that idle animation which has arm and torso keyframes is somehow breaking it? Should i just remove every walking keyframe except for arms? But then the walking while not equipping a sword would look bad. How do i go about this? Thanks!