Bavarium
|
  |
| Joined: 05 May 2011 |
| Total Posts: 12419 |
|
|
| 15 May 2016 01:50 PM |
function onSlash() local Human = game.Players.LocalPlayer.Character.Humanoid local animTrack = Human:LoadAnimation('http://www.roblox.com/asset/?id=414952662') animTrack:Play()
end script.Parent.Activated:connect(onSlash)
whenever I activate the tool i get this error 14:48:33.944 - Unable to cast value to Object 14:48:33.944 - Script 'Players.Player1.Backpack.Sword.LocalScript', Line 3 14:48:33.945 - Stack End
|
|
|
| Report Abuse |
|
|
KLGA
|
  |
| Joined: 19 Apr 2014 |
| Total Posts: 2571 |
|
|
| 15 May 2016 01:51 PM |
| When loading an animation, it has to be an animation object, not a string. |
|
|
| Report Abuse |
|
|
|
| 15 May 2016 01:51 PM |
| Which one is line 3? Make sure it's Sword.LocalScript you're reading from |
|
|
| Report Abuse |
|
|
Bavarium
|
  |
| Joined: 05 May 2011 |
| Total Posts: 12419 |
|
|
| 15 May 2016 01:52 PM |
@ham 3rd is the human:loadanimation one but yeah its in a localscript
|
|
|
| Report Abuse |
|
|
KLGA
|
  |
| Joined: 19 Apr 2014 |
| Total Posts: 2571 |
|
|
| 15 May 2016 01:54 PM |
| When loading an animation, it has to be an animation object, not a string. [2] |
|
|
| Report Abuse |
|
|
|
| 15 May 2016 01:58 PM |
Anyways, KLGA told you how to solve the problem. Make an actual animation inside the sword and then load the object not the string. |
|
|
| Report Abuse |
|
|
Bavarium
|
  |
| Joined: 05 May 2011 |
| Total Posts: 12419 |
|
|
| 15 May 2016 02:07 PM |
thanks klg, it works now :)
|
|
|
| Report Abuse |
|
|