#Why doesn't this work ( im very new to roblox studio)
16 messages · Page 1 of 1 (latest)
it still doesn't work?
Put a print after the first “then” and before the :Play()
Basically debug it
Dude try using humanoid:LoadAnimation(punchanimation)
Replace animator:LoadAnimation with humanoid:LoadAnimation
it doesnt find an animator
** You are now Level 1! **
i changed it to this:
local plr = game:GetService("Players").LocalPlayer
local timeout = 2
local character = plr.Character
local UIS = game:GetService("UserInputService")
if not character or not character.Parent then
character = plr.CharacterAdded:Wait()
end
local humanoid = character:WaitForChild("Humanoid", timeout)
local animator = character:WaitForChild("Animator", timeout)
if animator then
print("animator")
else
print("no animator found")
animator = Instance.new("Animator")
animator.Name = "Animator"
animator.Parent = humanoid
end
if humanoid then
print("humanoid")
else
print("no humanoid")
end
local punchAnimation = Instance.new("Animation")
punchAnimation.AnimationId = "rbxassetid://11451594969"
local track = humanoid:LoadAnimation(punchAnimation)
UIS.InputBegan:Connect(function(Input, IsTyping)
if IsTyping then return end
if Input == Enum.UserInputType.MouseButton1 then
print("MouseClicked")
track:Play()
end
end)
but it doesnt print MouseClicked when i click
If input.UserInputType