Itz_N3p1
(Itz_N3p1)
September 20, 2020, 7:23pm
#1
(Sorry for posting like everyday lol)
Here’s the code
local Humanoid = script.Parent:WaitForChild("Humanoid")
local RunAnimation = Instance.new("Animation")
RunAnimation.AnimationId = {"5714097257","5714126840"}
local RandomAnimation = Humanoid:LoadAnimation()
local SV = RunAnimation[math.random(5, #RunAnimation )]
RandomAnimation = (SV)
It wants me to covert my table into a string, I have no idea how to do that.
Thanks for any help! : D
Bliksem18
(cos2005)
September 20, 2020, 7:34pm
#2
You have to put in 1 animationId as a string and not a table.If you want to have multiple animations, you have to create two animations with the two Id’s.
1 Like
By the way, the format for asset ids rbxassetid://
with your ID after it.
1 Like
Itz_N3p1
(Itz_N3p1)
September 20, 2020, 7:36pm
#4
Yeah, but I have no idea how to do strings. ;/
Itz_N3p1
(Itz_N3p1)
September 20, 2020, 7:37pm
#5
Oh right, that’s my bad lol. : /
Bliksem18
(cos2005)
September 20, 2020, 7:39pm
#6
just do
local Humanoid = script.Parent:WaitForChild("Humanoid")
local RunAnimation1 = Instance.new("Animation")
local RunAnimation2 = Instance.new("Animation")
RunAnimation1.AnimationId = "rbxassetid://5714097257"
RunAnimation2.AnimationId = "rbxassetid://5714126840"
local RandomAnimation = Humanoid:LoadAnimation()
local SV = RunAnimation[math.random(5, #RunAnimation )]
RandomAnimation = (SV)
You have to say which animation you want to load with LoadAnimation()
1 Like
Itz_N3p1
(Itz_N3p1)
September 20, 2020, 7:42pm
#7
I assume now it has something to do with the local SV because “RunAnimation” now doesn’t exist.
Bliksem18
(cos2005)
September 20, 2020, 7:43pm
#8
Yes indeed, I want to talk a little bit more because length post
1 Like
Itz_N3p1
(Itz_N3p1)
September 20, 2020, 7:44pm
#9
Oh alright, I can stick around for a bit.
Bliksem18
(cos2005)
September 20, 2020, 7:45pm
#10
no that post was because 30 caracters
Itz_N3p1
(Itz_N3p1)
September 20, 2020, 7:50pm
#11
Oh, sorry. I haven’t really been on the devforum lately till now.
This should fix it:
local RunAnimation1 = youranimplace
local RunAnimation2 = youranimplace
RunAnimation1.AnimationId = "rbxassetid://5714097257"
RunAnimation2.AnimationId = "rbxassetid://5714126840"
local RandomAnimation = Humanoid:LoadAnimation(RunAnimation1)
local RandomAnimation2 = Humanoid:LoadAnimation(RunAnimation2)
Make sure to play the anims
You have to use Humanoid:LoadAnimation() and put the animation within those parenthesis,
local Animations = {
RunAnimation1 = Instance.new("Animation", script.Parent);
RunAnimation2 = Instance.new("Animation", script.Parent);
};
Animations.RunAnimation1.AnimationId = "rbxassetid://idhere";
Animations.RunAnimation2.AnimationId = "rbxassetid://idhere";
local RandomAnimation = Humanoid:LoadAnimation(Animations[math.random(1, 2)]);
1 Like
Itz_N3p1
(Itz_N3p1)
September 20, 2020, 10:57pm
#14
I’ve been trying a lot of different things using your script, but I keep getting this issue :