Troubling animations always screw me.. ( Any help? )
Asked by
7 years ago Edited 7 years ago
I'm trying to make a tool that when you click it, It plays an animation and it gives a menu to the player that the person clicked. I've already created a script for giving the "GiveMenu" tool to the player. I get an error about the Animation failing to load when I get the tool in my Inventory, and when I click a player. Any help?
Note: I put all of this into a Local Script and the tool is located in Server Storage.
Errors:
"Animation "http://www.roblox.com//asset/?id=44911345&serverplaceid=1372052778" failed to load in "Animation.AnimationId": Animation failed to load"
"Players.LennonLight.Backpack.GiveMenu.Animation:11: attempt to index local 'whatWasClicked' (a nil value) (Line 11)"
01 | local animation = Instance.new( "Animation" ) |
03 | local plr = game.Players.LocalPlayer |
04 | local Mouse = plr:GetMouse() |
05 | local player = plr.Character |
08 | animTrack = player.Humanoid:LoadAnimation(animation) |
10 | Mouse.Button 1 Down:connect( function (whatWasClicked) |
11 | if whatWasClicked.Parent.Name = = "Torso" then |
14 | player:FindFirstChild( "Backpack" ).GiveMenu:Destroy() |
15 | game.ServerStorage.GiveMenu:Clone().Parent = whatWasClicked:FindFirstChild( "Backpack" ) |
16 | if whatWasClicked.Backpack = = nil then |
17 | game.ServerStorage.GiveMenu:Clone().Parent = whatWasClicked.Character:FindFirstChild( "Backpack" ) |