#animation not loading in actual game
7 messages · Page 1 of 1 (latest)
** You are now Level 2! **
i did press publish
may i take a look at the code for the tool ?
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local tool = script.Parent
local idle = char:WaitForChild("Humanoid"):LoadAnimation(script.Animations.Idle)
local canUse = false
tool.Equipped:Connect(function()
canUse = true
idle:Play(0.00000001)
end)
tool.Unequipped:Connect(function()
canUse = false
idle:Stop()
end)
local uis = game:GetService("UserInputService")
local m1 = char:WaitForChild("Humanoid"):LoadAnimation(script.Animations.M1)
local m2 = char:WaitForChild("Humanoid"):LoadAnimation(script.Animations.M2)
local m3 = char:WaitForChild("Humanoid"):LoadAnimation(script.Animations.M3)
local combo = 0
local debounce = false
uis.InputBegan:Connect(function(i,e)
if e then return end
if i.UserInputType == Enum.UserInputType.MouseButton1 then
if debounce == true then return end
if canUse == true then
if combo == 2 then
m3:Play(0.00000001)
m3.Looped = false
debounce = true
game.ReplicatedStorage.Remotes.Server:FireServer("LastHit")
task.delay(.5,function()
combo = 0
debounce = false
m3:Stop(0.00000001)
end)
elseif combo == 1 then
m2:Play(0.00000001)
m2.Looped = false
combo = combo + 1
debounce = true
game.ReplicatedStorage.Remotes.Server:FireServer()
task.delay(.3,function()
debounce = false
m2:Stop(0.00000001)
end)
elseif combo == 0 then
m1:Play(0.00000001)
m1.Looped = false
combo = combo + 1
debounce = true
game.ReplicatedStorage.Remotes.Server:FireServer()
task.delay(.3,function()
debounce = false
m1:Stop(0.00000001)
end)
end
end
end
end)