So i was making my game and decided to use animations... i put together a quick little script here's my code:
player = game.Players.LocalPlayer enabled = true mouse = player:GetMouse() local animation = Instance.new("Animation") animation.AnimationId = "rbxassetid://279736514" animation.Parent = script mouse.Button1Down:connect(function() animationTrack = player.Character.Humanoid:LoadAnimation(animation) animationTrack:Play() end)
When i test out the script and output says
21:29:04.649 - httpGet http://www.roblox.com/asset/?id=279736514&serverplaceid=245883628 failed. Trying again. Error: HTTP 403 (HTTP/1.1 403 Asset is not trusted for this place). Elapsed time: 0.10199 21:29:04.748 - Content failed for http://www.roblox.com//asset/?id=279736514&serverplaceid=245883628 because HTTP 403 (HTTP/1.1 403 Asset is not trusted for this place) 21:29:04.748 - Content failed because HTTP 403 (HTTP/1.1 403 Asset is not trusted for this place) 21:29:04.749 - Animation failed to load : Players.Player.Backpack.LocalScript.Animation>
i own this script and everything associated with it. I am also logged into studio so i don't understand whats going on
I believe the issue is that you're using a LocalScript. I don't think LocalScripts are allowed to access private assets. Try running the animation from the server.
Here's an example of how you could do this:
[create a RemoteEvent called "RequestAnimationPlay" in ReplicatedStorage]
[LocalScript]
local RequestAnimationPlay = game.ReplicatedStorage.RequestAnimationPlay player = game.Players.LocalPlayer mouse = player:GetMouse() mouse.Button1Down:connect(function() RequestAnimationPlay:FireServer() end)
[Script]
local RequestAnimationPlay = game.ReplicatedStorage.RequestAnimationPlay enabled = true local animation = Instance.new("Animation") animation.AnimationId = "rbxassetid://279736514" animation.Parent = script RequestAnimationPlay.OnServerEvent:connect(function(player) animationTrack = player.Character.Humanoid:LoadAnimation(animation) animationTrack:Play() end)