|
| 03 Jan 2013 07:40 AM |
| I am trying to animate a shield bash for a tool I have, but how do I insert this into the tool? I have the animation done, but cannot utilize it I tried the animate (play) tool, but that didn't work. Please help. |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 07:41 AM |
| Your forum post doesn't give enough information for anyone to help you. |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 08:00 AM |
| How do I script an animation to play when click a button? And where do I put the script inside of a tool so that it will play with the tool in hand? |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 08:12 AM |
Okay so firstly, what do you mean by "click a button", and secondly, the sound should be put in a place that is easily accessible like in the tool itself as the script can then call on the sound. As for the button you click, I'm not sure exactly what you mean, but I think you mean a button on your keyboard after you pull the weapon out. If you mean pressing a button on your keyboard it goes like this:
script.Parent.Equipped:connect(function(m) m.KeyDown:connect(function(k) if k=='k'then script.Parent.ANIMATION:Play() end end) end) |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 08:20 AM |
| Okay thanks, do I just put the script above in the sword script? Or seperate? |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 08:24 AM |
You could do
function WhateverShieldDoes() --Coding for Shield end
script.Parent.Equipped:connect(function(m) m.KeyDown:connect(function(k) if k=='k'then WhateverShieldDoes() script.Parent.ANIMATION:Play() end end) end) |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 08:31 AM |
| The sword and shield are both being worn? If this is the case, how is the shield being equipped to their arm when tools automatically equip to only one arm? |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 08:31 AM |
| My point is... the shield is technically not a tool then. |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 09:48 AM |
| The shield and sword are both together in the tool similar to the spartan sword and shield. |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Jan 2013 09:49 AM |
| I've never used it, so I'm not familiar with it's hierarchy. That means I can't help with a script, but I the idea of how to play the animation is the same I'm sure. |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 09:53 AM |
| Okay. The shield is just welded to the arm and I animated it so that the shield arm moves. That will move anything welded to it (i.e the shield). Right? |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 09:54 AM |
| Yes, if a block is welded to another block, and one of them moves, the other will move with it. |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 09:57 AM |
| Okay and I just put the script in separately. |
|
|
| Report Abuse |
|
|