Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What exactly is wrong with my animation script?

Asked by 8 years ago

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

0
It seems that the animation that you are using is not one that you own, unfortunately only animation you make are permitted in your place as far as I know dragonkeeper467 453 — 8y
0
i own the animation koolkid8099 705 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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)
0
it still says the same thing in output, i dont understand IF I OWN IT >:O koolkid8099 705 — 8y
0
nvm koolkid8099 705 — 8y
Ad

Answer this question