So I am trying to make a gun script, and I keep getting this same error "LoadAnimtion is not a valid member of Humanoid" what can I do to fix this?!?
Script :
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Tool = script.Parent
local FirePosition = Tool.Barrel.FirePoint
local MuzzleFlash = Tool.MuzzleFlash
local PointLight = MuzzleFlash.PointLight
local Decal1 = MuzzleFlash.Decal1
local Decal = MuzzleFlash.Decal
--//ANIMATIONS\\--
-- .AnimationId = "rbxassetid://" --
local EquipAnim = Instance.new("Animation",Humanoid)
EquipAnim.AnimationId = "rbxassetid://7532156999"
Humanoid:LoadAnimtion(EquipAnim)
local IdleAnim = Instance.new("Animation",Humanoid)
IdleAnim.AnimationId = "rbxassetid://7532122198"
Humanoid:LoadAnimtion(IdleAnim)
local Inspect = Instance.new("Animation",Humanoid)
Inspect.AnimationId = "rbxassetid://"
Humanoid:LoadAnimtion(Inspect)
local RecoildAnim = Instance.new("Animation",Humanoid)
RecoildAnim.AnimationId = "rbxassetid://7532109351"
Humanoid:LoadAnimtion(RecoildAnim)
local ReloadAnim = Instance.new("Animation",Humanoid)
ReloadAnim.AnimationId = "rbxassetid://"
Humanoid:LoadAnimtion(ReloadAnim)
--//SOUNDS\\--
local ReloadSound = Tool.Handle.ReloadSound
local ShootSound = Tool.Handle.ShootSound
--//DEBOUNCE\\--
local debounce = false
--//SETTINGS\\--
local Ammo = 60
local Mag = 120
local Cooldown = 0.05
local Damage = 35
--// SCRIPT \\--
Tool.Equipped:Connect(function()
EquipAnim:Play()
wait(1)
IdleAnim:Play()
EquipAnim:Stop()
Mouse.Button1Down:Connect(function()
PointLight.Enabled = true
Decal.Transparency = 0
Decal1.Transparency = 0
ShootSound:Play()
RecoildAnim:Play()
IdleAnim:Stop()
wait(0.1)
PointLight.Enabled = false
Decal.Transparency = 1
Decal1.Transparency = 1
RecoildAnim:Stop()
IdleAnim:Play()
end)
end)

1 comment
Thank you!