#18:54:20.172 LoadAnimation requires the asset id to not be empty - Server - AI Chase:46

43 messages · Page 1 of 1 (latest)

supple gorge
#

local animationId = "rbxassetid://14359851532"

still iron
#

Would you want us to guess the code?

supple gorge
#

yes

#

function playDanceAnimation()
local humanoid = NPC:FindFirstChildOfClass("Humanoid")
if humanoid then
local animationId = "rbxassetid://14359851532"
local animationTrack = humanoid:LoadAnimation(Instance.new("Animation"))
animationTrack.AnimationId = animationId
animationTrack:Play()
animationTrack.Stopped:Wait()
end
end

azure obsidian
# supple gorge function playDanceAnimation() local humanoid = NPC:FindFirstChildOfClass("Hu...

This may work. (I may have the caps wrong)

function playDanceAnimation()
local humanoid = NPC:FindFirstChildOfClass("Humanoid")
if humanoid then
local animationId = "rbxassetid://14359851532"
local animationTrack = Instance.new("Animation")
humanoid:LoadAnimation(animationTrack)
animationTrack.AnimationId = animationId
animationTrack:Play()
animationTrack.Stopped:Wait()
end
end

#

Tell me if it worked.

supple gorge
#

alr i try it now

#

Workspace.Rarity Npc.Smart Npc.AI Chase:49: attempt to index nil with 'new'

azure obsidian
#

I mean......

supple gorge
#

luau

azure obsidian
#

Let me make you a simple script hold on.

supple gorge
#

i fixed it

function playDanceAnimation()
local humanoid = NPC:FindFirstChildOfClass("Humanoid")
if humanoid then
local animationId = "rbxassetid://14359851532"
local animationInstance = Instance.new("Animation") -- Create a new instance of the "Animation" class
animationInstance.AnimationId = animationId -- Set the animation ID for the new instance
local animationTrack = humanoid:LoadAnimation(animationInstance) -- Load the animation using the instance
animationTrack:Play()
animationTrack.Stopped:Wait()
end
end

#

but ty for your help

azure obsidian
#

Honestly.

hardy arrowBOT
#

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

azure obsidian
#

Ive never seen LUA like that.

#

I create more simple scripts.

still iron
supple gorge
#

i have a new problem

#

20:32:30.273 Position is not a valid member of Model "Workspace.Rarity Npc.Smart Npc" - Server - AI Chase:189

#

for i = 1, numPoints do
local randomPoint = Vector3.new(
NPC.Position.X + math.random(-maxDistanceFromPath, maxDistanceFromPath),
0,
NPC.Position.Z + math.random(-maxDistanceFromPath, maxDistanceFromPath)
)

azure obsidian
#

Is LUAU LUA?

supple gorge
#

nope

azure obsidian
#

Im so confused.

supple gorge
#

luau is lua but with big changes

still iron
#

Lua is the original language
Luau is the language lua but a little bit changed to work for Roblox

azure obsidian
#

I just use LUA.

#

So I am using LUAU?

supple gorge
still iron
#

luau is just for Roblox Studio

azure obsidian
#

Oh then I am using LUAU

supple gorge
still iron
#

luau has everthing lua has but in adition with stuff like "script", "parent", "position", everything that is used in a game engine

#

tip: dont use space for instance's names

#

And what kind of instance is "NPC"?

supple gorge
#

that the instance right?

local NPC = game.Workspace["Rarity Npc"]["Smart Npc"]

still iron
#

Yes, but what type of instance is it?

supple gorge
#

Model

still iron
#

Not sure you can change the position of a model

#

You need to change the position of the primary part of the model