|
| 18 Jul 2015 11:44 AM |
This is a local script inside a gui button and when you click it, it runs an animation. When i click it, my character doesn't do anything.
plr=game.Players.LocalPlayer char=plr.Character script.Parent.MouseButton1Click:connect(function() local anim=char.Humanoid:LoadAnimation(script.Animation) anim:Play() end) |
|
|
| Report Abuse |
|
|
| |
|
ShungTzu
|
  |
| Joined: 14 Jun 2014 |
| Total Posts: 959 |
|
|
| 18 Jul 2015 11:50 AM |
In a LocalScript, in StarterGui, put:
plr=game.Players.LocalPlayer char=player.Character or player.CharacterAdded:wait() human=char:WaitForChild('Humanoid') anim=char.Humanoid:LoadAnimation(script.Animation)
ThatButton.MouseButton1Click:connect(function() anim:Play() end) |
|
|
| Report Abuse |
|
|
ShungTzu
|
  |
| Joined: 14 Jun 2014 |
| Total Posts: 959 |
|
|
| 18 Jul 2015 11:52 AM |
| player should be your "plr", I'm just used to typing it that way. |
|
|
| Report Abuse |
|
|
| |
|
ShungTzu
|
  |
| Joined: 14 Jun 2014 |
| Total Posts: 959 |
|
|
| 18 Jul 2015 11:53 AM |
| I've done it hundreds of times. It always works. |
|
|
| Report Abuse |
|
|
| |
|
ShungTzu
|
  |
| Joined: 14 Jun 2014 |
| Total Posts: 959 |
|
|
| 18 Jul 2015 11:55 AM |
| You didn't actually leave the literal "ThatButton" in there, did you? The animation is in the script, right? |
|
|
| Report Abuse |
|
|
ShungTzu
|
  |
| Joined: 14 Jun 2014 |
| Total Posts: 959 |
|
|
| 18 Jul 2015 11:56 AM |
| Is it an animation you created on that same profile? |
|
|
| Report Abuse |
|
|
|
| 18 Jul 2015 11:57 AM |
| Yes, and i did "script.Parent" instead of "ThatButton" |
|
|
| Report Abuse |
|
|
|
| 18 Jul 2015 12:00 PM |
| Im going to look on the wiki |
|
|
| Report Abuse |
|
|
|
| 18 Jul 2015 12:14 PM |
| Wtf not even the wiki example works. |
|
|
| Report Abuse |
|
|
ShungTzu
|
  |
| Joined: 14 Jun 2014 |
| Total Posts: 959 |
|
|
| 18 Jul 2015 12:29 PM |
| Have you ever seen that animation play? |
|
|
| Report Abuse |
|
|
| |
|
ShungTzu
|
  |
| Joined: 14 Jun 2014 |
| Total Posts: 959 |
|
|
| 18 Jul 2015 06:46 PM |
Check the url in the Animation.
Change
anim=char.Humanoid:LoadAnimation(script.Animation)
to
anim=human:LoadAnimation(script.Animation)--just in case
.
Import the Animation into the Editor and make sure it's it.
Print the result of every line to make sure it's happening.
After that, I don't know. I'd have to be there. |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2015 10:05 AM |
| Sometimes it doesn't even fire when the button is clicked. Is it because i have a gui behind it with the same Zindex? |
|
|
| Report Abuse |
|
|
ShungTzu
|
  |
| Joined: 14 Jun 2014 |
| Total Posts: 959 |
|
| |
|
Whoami102
|
  |
| Joined: 25 Jul 2013 |
| Total Posts: 131 |
|
|
| 19 Jul 2015 12:34 PM |
| Put the animation in the gui! Don't put it in the script! Things like sounds a animations don't work inside the executioner! |
|
|
| Report Abuse |
|
|
ShungTzu
|
  |
| Joined: 14 Jun 2014 |
| Total Posts: 959 |
|
|
| 19 Jul 2015 12:48 PM |
| Mine don't seem to know that rule. They always play anyway. |
|
|
| Report Abuse |
|
|