When I use this click to run animation script I get this error(I'm working on a fighting game) The Error is 21:00:04.573 LoadAnimations is not a valid member of Humanoid "Workspace.LoneSpace_Ranger.Humanoid" - Server - CombatSystem:18
I cant fix it here is the combat script:
local Player = game:GetService("Players").LocalPlayer
local rp = game:GetService("ReplicatedStorage")
local Combat = rp:WaitForChild("Combat")
local UIS = game:GetService("UserInputService")
local debounce = false
local cd = .25
local currTime = 0
local prevTime = 0
local count = 0
UIS.InputBegan:Connect(function(input, isTyping)
if isTyping then
return
elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
if debounce == false then
debounce = true
currTime = tick()
local passedtime = currTime - prevTime
if passedtime < 1 then
--Can Continue Combo
count = count + 1
if count > 4 then
count = 1
end
else
--Restarts Combo
count = 1
end
Combat:FireServer(count)
end
end
end)
Combat.OnClientEvent:Connect(function()
wait(cd)
debounce = false
end)
This Is The Combat System Script
local rp = game:GetService("ReplicatedStorage")
local Combat = rp:WaitForChild("Combat")
local Animations = script:WaitForChild("Animations")
local anims =
{
Animations:WaitForChild("Kick"),
Animations:WaitForChild("Left"),
Animations:WaitForChild("Right"),
Animations:WaitForChild("Gut"),
}
Combat.OnServerEvent:Connect(function(player,count)
local Character = player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local attack = Humanoid:LoadAnimations(anims[count])
attack:Play()
Combat.FireClient(player)
end)
Thank You In Advance
