#A quick math.random code

1 messages · Page 1 of 1 (latest)

cobalt spear
#

basically im trying to randomly play an animation

but it isnt picking one what do i do?

script right here:
local rig = script.Parent
local humanoid = rig:FindFirstChildOfClass("Humanoid")
local animations = {
"rbxassetid://10714347256",
"rbxassetid://10714369624",
"rbxassetid://10713992055",
"rbxassetid://10714350889",
"rbxassetid://10713984554",
"rbxassetid://10714386947",
"rbxassetid://10713990381",
"rbxassetid://15698511500",
"rbxassetid://3762654854",
"rbxassetid://17360699557",
"rbxassetid://10714378156",
"rbxassetid://132748833449150",
"rbxassetid://18526362841"

}
local animator = humanoid:FindFirstChildOfClass("Animator")
if not animator then
-- If an Animator doesn't exist, create one.
animator = Instance.new("Animator")
animator.Parent = humanoid
end

local animation = Instance.new("Animation")
animation.AnimationId = math.random(1,#animations)
animation.Parent = rig

local animationTrack = animator:LoadAnimation(animation)
animationTrack.Looped = true
animationTrack:Play()

left quartz
#

this the first post I found on it

cobalt spear
#

wait thats smart

#

thank you so much

#

wait

#

Workspace.Level5.PlayersThing.First.Rig.Dance First:27: attempt to concatenate string with table

cedar domeBOT
#

studio** You are now Level 2! **studio

cobalt spear
#

i got this?

left quartz