This will probaly be like 1 of the last times I ask for help when Scripting.
but um, I am making this Animation shop the only problem is when the player tries to equip it
the animation dosnt show up or work, its still the default animation. i tried parenting it to the character it didnt work, i tried doing startercharacter and it didnt work any way i can fix this?
| S C R I P T |
game.Players.PlayerAdded:Connect(function(Player)
local leaderstats = Instance.new("Folder", Player)
leaderstats.Name = "leaderstats"
local PlayersAnims = Instance.new("Folder", Player)
PlayersAnims.Name = "PlayersAnims"
local SC = Instance.new("NumberValue", leaderstats)
SC.Name = "SpeedCoinz"
SC.Value = 10000
local OwnsScoutFlyerAnim = Instance.new("BoolValue", PlayersAnims)
OwnsScoutFlyerAnim.Name = "ScoutFlyerAnim"
OwnsScoutFlyerAnim.Value = false
game.ReplicatedStorage.RemoteEvents.BuyScoutFlyerAnim.OnServerEvent:Connect(function(plr)
plr.leaderstats.SpeedCoinz.Value -= 750
plr.PlayersAnims.ScoutFlyerAnim.Value = true
print("Player Now Owns Scout Flyer")
end)
game.ReplicatedStorage.RemoteEvents.EquipScoutFlyerAnim.OnServerEvent:Connect(function(plr)
local char = plr.Character
local customanim = game.ServerStorage.PlayerAnimations.ScoutFlyer.Animate
plr:LoadCharacter()
local CurrentCharAnim = char:FindFirstChild("Animate")
wait()
CurrentCharAnim:Destroy()
wait()
if not char:FindFirstChild("IsCustom") then
local newAnim = customanim:Clone()
newAnim.Parent = char
end
end)
end)
local loadedanim = char.Humanoid.Animator:LoadAnimation(customanim)
loadedanim:Play()
Also, to remove animations do:
local playinganims = char.Humanoid.Animator:GetPlayingAnimationTracks()
for i, anim in pairs(playinganims) do
if anim and anim.Name == "Animate" then
anim:Stop()
end
end
wait will this work with the script itself like
its a custom walk, run, jump etc animation itself does it still work like that?
im still learning about animations
like its a animation Script.
for example if i tested the game i would go inside the player
and take the animation script, so thats what i have and i edit the animation id
and etc. just to make this clear
i also got this error saying load anim requires a animation or something
game.Players.PlayerAdded:Connect(function(Player)
local leaderstats = Instance.new(“Folder”, Player)
leaderstats.Name = “leaderstats”
local PlayersAnims = Instance.new("Folder", Player)
PlayersAnims.Name = "PlayersAnims"
local SC = Instance.new("NumberValue", leaderstats)
SC.Name = "SpeedCoinz"
SC.Value = 10000
local OwnsScoutFlyerAnim = Instance.new("BoolValue", PlayersAnims)
OwnsScoutFlyerAnim.Name = "ScoutFlyerAnim"
OwnsScoutFlyerAnim.Value = false
game.ReplicatedStorage.RemoteEvents.BuyScoutFlyerAnim.OnServerEvent:Connect(function(plr)
plr.leaderstats.SpeedCoinz.Value -= 750
plr.PlayersAnims.ScoutFlyerAnim.Value = true
print("Player Now Owns Scout Flyer")
end)
game.ReplicatedStorage.RemoteEvents.EquipScoutFlyerAnim.OnServerEvent:Connect(function(plr)
local char = plr.Character
local customanim = game.ServerStorage.PlayerAnimations.ScoutFlyer.Animate
plr:LoadCharacter()
local playinganims = char.Humanoid.Animator:GetPlayingAnimationTracks()
for i, anim in pairs(playinganims) do
if anim and anim.Name == "Animate" then
anim:Stop()
end
end
wait()
if not char:FindFirstChild("IsCustom") then
local loadedanim = char.Humanoid.Animator:LoadAnimation(customanim)
loadedanim:Play()
end
end)
i really dont think i could do this sorry.
i shouldnt of went with something this big but ill try explaining this a lil more
the animation is a script with all animation id’s inside the script’s code
and animation id’s inside the script itself
the animation ids are inside IntValues which are inside the Script.
also im still getting a error it couldnt find the anim or anything theres just nothing we can do.
i have to make something else.
but rn ima just take a break from developing.