How to get animation id from intvalue

how to get animation id from intvalue (eg 7198237)
and if intval has no value/id it will wait till theres a value

image

local hum = script.Parent.Humanoid
local intVal = script.intValue
local anim = script.Animation.AnimationId -- idk where toput this lol

local LoadAnimID = "rbxassetid://"..intVal
local play = hum:LoadAnimation(LoadAnimID)
play:Play()
local LoadAnimID = "rbxassetid://" .. tostring(intVal)

Convert your IntValue to a string using the tostring() function. It will be able to concatenate.

ERROR
Unable to cast value to Object
Line: 6

My bad.

You have to reference its’ Value.

local LoadAnimID = "rbxassetid://" .. tostring(intVal.Value)
1 Like

i already fix that
i think theres something todo with the, Local anim, like how do i apply the rbxassetid and the invtval
to the Animation.AnimationID = section

What do you mean?

Are you talking about setting your LoadAnimID to your Animations’ AnimationId?
If this is correct, then simply do:

local anim = script.Animation -- I wouldn't reference .AnimationId in this variable. Just reference the Animation object instead.
local LoadAnimID = "rbxassetid://" .. tostring(intVal.Value)

anim.AnimationId = LoadAnimID
1 Like

thx but
exception while signaling: Cannot load the AnimationClipProvider Service.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.