#inf yeild thing

1 messages · Page 1 of 1 (latest)

lyric rune
#

so i got a m1 cycle script im doing and i made it so that it prints which m1 is gonna play, there are no errors but it js gives me an inf yeild thing ```lua
local UserInputService = game:GetService("UserInputService")
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")

-- anim thingthings
local punch1 = script:WaitForChild("Punch1")
local punch2 = script:WaitForChild("Punch2")

local punch1AnimTrack = humanoid:LoadAnimation(punch1)
local punch2AnimTrack = humanoid:LoadAnimation(punch2)

-- actuall code thingthings
local userInput = UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
local punches = 1
if input == Enum.KeyCode.MouseLeftButton then
if punches == 1 then
print("punch 1")
punches = 2
elseif punches == 2 then
print("punch 2")
punches = 1
task.wait(0.5)
end
end
end)

pliant viper
lyric rune
#

u right

#

should i js use find?

pliant viper
#

i mean waitforchild can be useful

#

just

#

make sure it exists?

#

like ever

#

if infinite yield then the name u provided is never existing

#

so check your paths

lyric rune
dreamy coral
#

Also you should prolly move ur punches counter outside your input, so it’s not setting to 1 every input

pliant viper
#

oh yw

#

ye

#

and erm technically u should use loadnimation on animator

#

not humanoid

minor bloomBOT
#

studio** You are now Level 8! **studio