Alrighty, yes! your script accomplished my first goal, which was to change the script the first time, now my main intention is to be able to change it multiple times possibly in my shop. Let me show you my whole animation changer script
local aksdfkjf = false
local Players = game:GetService("Players")
local function onCharacterAdded(character)
local humanoid = character:WaitForChild("Humanoid")
print("haha")
for _, playingTracks in pairs(humanoid:GetPlayingAnimationTracks()) do
playingTracks:Stop(0)
end
local animateScript = character:WaitForChild("Animate")
wait(1)
local firstAnimation = animateScript:WaitForChild("run"):WaitForChild("RunAnim")
local firstAnimationClone = firstAnimation:Clone()
animateScript.run.RunAnim:Destroy()
firstAnimationClone.AnimationId = "rbxassetid://616010382"
local secondAnimation = animateScript.walk.RunAnim
local secondAnimationClone = secondAnimation:Clone()
animateScript.walk.RunAnim:Destroy()
secondAnimationClone.AnimationId = "rbxassetid://616013216"
local thirdAnimation = animateScript.jump.JumpAnim
local thirdAnimationClone = thirdAnimation:Clone()
animateScript.jump.JumpAnim:Destroy()
thirdAnimationClone.AnimationId = "rbxassetid://616008936"
local fourthAnimation = animateScript.idle.Animation1
local fourthAnimationClone = fourthAnimation:Clone()
animateScript.idle.Animation1:Destroy()
fourthAnimationClone.AnimationId = "rbxassetid://616006778"
local fifthAnimation = animateScript.idle.Animation2
local fifthAnimationClone = fifthAnimation:Clone()
animateScript.idle.Animation2:Destroy()
fifthAnimationClone.AnimationId = "rbxassetid://616008087"
local sixthAnimation = animateScript.fall.FallAnim
local sixthAnimationClone = sixthAnimation:Clone()
animateScript.fall.FallAnim:Destroy()
sixthAnimationClone.AnimationId = "rbxassetid://616005863"
local seventhAnimation = animateScript.swim.Swim
local seventhAnimationClone = seventhAnimation:Clone()
animateScript.swim.Swim:Destroy()
seventhAnimationClone.AnimationId = "rbxassetid://616011509"
local eighthAnimation = animateScript.swimidle.SwimIdle
local eighthAnimationClone = eighthAnimation:Clone()
animateScript.swimidle.SwimIdle:Destroy()
eighthAnimationClone.AnimationId = "rbxassetid://616012453"
local ninthAnimation = animateScript.climb.ClimbAnim
local ninthAnimationClone = ninthAnimation:Clone()
animateScript.climb.ClimbAnim:Destroy()
ninthAnimationClone.AnimationId = "rbxassetid://616003713"
end
local function onCharacterAddedOther(character)
local humanoid = character:WaitForChild("Humanoid")
print("haha")
for _, playingTracks in pairs(humanoid:GetPlayingAnimationTracks()) do
playingTracks:Stop(0)
end
local animateScript = character:WaitForChild("Animate")
wait(1)
local firstAnimation = animateScript:WaitForChild("run"):WaitForChild("RunAnim")
local firstAnimationClone = firstAnimation:Clone()
animateScript.run.RunAnim:Destroy()
firstAnimationClone.AnimationId = "rbxassetid://750783738"
local secondAnimation = animateScript.walk.RunAnim
local secondAnimationClone = secondAnimation:Clone()
animateScript.walk.RunAnim:Destroy()
secondAnimationClone.AnimationId = "rbxassetid://750785693"
local thirdAnimation = animateScript.jump.JumpAnim
local thirdAnimationClone = thirdAnimation:Clone()
animateScript.jump.JumpAnim:Destroy()
thirdAnimationClone.AnimationId = "rbxassetid://750782230"
local fourthAnimation = animateScript.idle.Animation1
local fourthAnimationClone = fourthAnimation:Clone()
animateScript.idle.Animation1:Destroy()
fourthAnimationClone.AnimationId = "rbxassetid://750781874"
local fifthAnimation = animateScript.idle.Animation2
local fifthAnimationClone = fifthAnimation:Clone()
animateScript.idle.Animation2:Destroy()
fifthAnimationClone.AnimationId = "rbxassetid://750782770"
local sixthAnimation = animateScript.fall.FallAnim
local sixthAnimationClone = sixthAnimation:Clone()
animateScript.fall.FallAnim:Destroy()
sixthAnimationClone.AnimationId = "rbxassetid://750780242"
local seventhAnimation = animateScript.swim.Swim
local seventhAnimationClone = seventhAnimation:Clone()
animateScript.swim.Swim:Destroy()
seventhAnimationClone.AnimationId = "rbxassetid://750784579"
local eighthAnimation = animateScript.swimidle.SwimIdle
local eighthAnimationClone = eighthAnimation:Clone()
animateScript.swimidle.SwimIdle:Destroy()
eighthAnimationClone.AnimationId = "rbxassetid://750785176"
local ninthAnimation = animateScript.climb.ClimbAnim
local ninthAnimationClone = ninthAnimation:Clone()
animateScript.climb.ClimbAnim:Destroy()
ninthAnimationClone.AnimationId = "rbxassetid://750779899"
end
local function whichAnim(character)
local player = game.Players:GetPlayerFromCharacter(character)
if not player:FindFirstChild("PlayerAnim") then
aksdfkjf = true
end
if player:WaitForChild('PlayerAnim').Value == "DefaultAnim" then
print("You have the DefaultAnimation")
player.CharacterAppearanceLoaded:Connect(onCharacterAdded)
end
if player:WaitForChild('PlayerAnim').Value == "OtherAnim" then
print("You have the OtherAnimation")
player.CharacterAppearanceLoaded:Connect(onCharacterAddedOther)
end
wait(1)
if aksdfkjf == true then
player:LoadCharacter()
aksdfkjf = false
end
end
local function onPlayerAdded(player)
player.CharacterAdded:Connect(whichAnim)
end
Players.PlayerAdded:Connect(onPlayerAdded)
This is a clip of my new issue, the DefaultAnim is what my character starts with, when I use the Proximity Prompt (my substitution for my shop until I get this whole terrible and funky issue fixed), it changes it to the OtherAnim, which is a pirate animation, but it wonât change as you can see.
robloxapp-20201215-1838488.wmv (4.6 MB)
(sorry I am unsure how to put a video on the forum from studio without it coming up as a download)
I am getting this error normally too, but it isnât affecting the gameâŚ
18:43:42.219 Infinite yield possible on 'Workspace.MRKYLO20.Animate.run:WaitForChild("RunAnim")' - Studio
18:43:42.220 Stack Begin - Studio
18:43:42.221 Script 'ServerScriptService.ChangeAnimationScript', Line 13 - function onCharacterAdded - Studio - ChangeAnimationScript:13
18:43:42.222 Stack End - Studio
I would think that this would halt the whole thing, but it doesnât, it may have nothing to do with the main problem, but I donât know?