|
| 03 Nov 2014 03:19 PM |
I have a local script.
function Hybric(key) local key = key:lower() if key == "e" then -- change "e" to the Key you want it to be script.Parent.Parent.Character.Humanoid:LoadAnimation(script.Parent.hybric):Play() -- hybric is the animation name, if you didnt put that as the name, change it to "hybric" end end
script.Parent.Parent:GetMouse().KeyDown:connect(Hybric)
what this script does is it plays an animation when a player presses "e" I was wondering, what do I need to add to this script to make the animation STAY when you're holding it for example if I press "e" with the script I have above, it will play the sitting animation for 1 second and then stop. what would I need to do to make it so that if the player HOLDS e, it will make the animation play and not finish until the player releases the button. sorry if it's confusing but it seems easy to do I just don't know if it requires a script or an actual animation reform.
will pay 100 robux for anyone who solves this, I will pay you the money first if you'd like, I don't see anyone taking more than 5 minutes doing this so try it if you want 100 robux! |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2014 03:22 PM |
function Hybric(key) local key = key:lower() if key == "e" then -- change "e" to the Key you want it to be while key == "e" do script.Parent.Parent.Character.Humanoid:LoadAnimation(script.Parent.hybric):Play() -- hybric is the animation name, if you didnt put that as the name, change it to "hybric" wait() -- you have to edit this if your animation keeps resetting and wont play threw end end end
script.Parent.Parent:GetMouse().KeyDown:connect(Hybric) |
|
|
| Report Abuse |
|
|
Raidorz
|
  |
| Joined: 28 Apr 2011 |
| Total Posts: 5221 |
|
|
| 03 Nov 2014 03:23 PM |
I'm a beginner but I think you need to use
for - do thing for loop thingy |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 03 Nov 2014 03:25 PM |
function Hybric(key) local key = key:lower() if key == "e" and not active then -- change "e" to the Key you want it to be active = true while active and wait() do script.Parent.Parent.Character.Humanoid:LoadAnimation(script.Parent.hybric):Play() -- hybric is the animation name, if you didnt put that as the name, change it to "hybric" end end end
script.Parent.Parent:GetMouse().KeyDown:connect(Hybric)
script.Parent.Parent:GetMouse().KeyUp:connect(function(key) if key:lower() == "e" then active = false end end) |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2014 03:30 PM |
1st script was good but even if u let go of the key, it still played the animation and the wait() was a problem, thank you for helping me anyway
2nd post, I'm a beginner too, no idea what loop means T_T
3rd post - thank you this is the one I am looking for, you aren't BC so I don't know how I could give you your 100 robux, you could make your game cost 100 robux to play but you will only get 10 robux from that or you can tell me who to give the 100 robux to |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 03 Nov 2014 04:03 PM |
| I have a donation system in my game |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2014 04:40 PM |
| rip off u should of made it 500 bux |
|
|
| Report Abuse |
|
|