#Why doesn't this work ( im very new to roblox studio)

16 messages · Page 1 of 1 (latest)

frosty spear
#

You did .WaitForChild

#

You need to do :WaitForChild

#

Other then that, it looks fine

dapper beacon
#

it still doesn't work?

frosty spear
#

Put a print after the first “then” and before the :Play()

frosty spear
#

Basically debug it

cold valley
#

Dude try using humanoid:LoadAnimation(punchanimation)

dapper beacon
#

where?

#

bc i already put it at local punchAnimationTrack

cold valley
#

Replace animator:LoadAnimation with humanoid:LoadAnimation

dapper beacon
#

it doesnt find an animator

cold valley
#

studio** You are now Level 1! **studio

dapper beacon
#

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

cold valley
#

If input.UserInputType