|
| 24 Dec 2014 04:46 PM |
| how can u make a script where when u click a brick with a click detector, it plays an animation? |
|
|
| Report Abuse |
|
|
Funse
|
  |
| Joined: 11 Jun 2012 |
| Total Posts: 7887 |
|
|
| 24 Dec 2014 04:47 PM |
If the animation is for the player, you'll have to use mouse.Target. lol |
|
|
| Report Abuse |
|
|
| |
|
Funse
|
  |
| Joined: 11 Jun 2012 |
| Total Posts: 7887 |
|
|
| 24 Dec 2014 05:01 PM |
| Player animations should be used with local scripts. |
|
|
| Report Abuse |
|
|
|
| 24 Dec 2014 05:03 PM |
| ok so how would i make it so if the player clicks a model named Ore, then it plays the animation? |
|
|
| Report Abuse |
|
|
| |
|
Funse
|
  |
| Joined: 11 Jun 2012 |
| Total Posts: 7887 |
|
|
| 24 Dec 2014 05:08 PM |
plr = game.Players.LocalPlayer mouse = plr:GetMouse() animation = animationlinkhere
mouse.Button1Down:connect(function() if mouse.Target = game.Workspace.Part then animTrack = plr.Character.Humanoid:LoadAnimation(animation) animTrack:Play() end end) |
|
|
| Report Abuse |
|
|
|
| 24 Dec 2014 05:38 PM |
| Thx, so i put the local script in starter Gear? |
|
|
| Report Abuse |
|
|
Funse
|
  |
| Joined: 11 Jun 2012 |
| Total Posts: 7887 |
|
|
| 24 Dec 2014 05:39 PM |
I prefer startergui. But that'll work too. |
|
|
| Report Abuse |
|
|
error9999
|
  |
| Joined: 05 Sep 2009 |
| Total Posts: 1593 |
|
| |
|
|
| 25 Dec 2014 04:13 AM |
| do i put the whole ling or just the last numbers from then link where it says animationlinkhere? |
|
|
| Report Abuse |
|
|
|
| 25 Dec 2014 04:27 AM |
heres the script :
plr = game.Players.LocalPlayer mouse = plr:GetMouse() animation = 'http://www.roblox.com/Take-item?id=196317735'
mouse.Button1Down:connect(function() if mouse.Target == game.Workspace.Ores.Ores1 or game.Workspace.Ores.Ores2 or game.Workspace.Ores.Ores3 or game.Workspace.Ores.Ores4 or game.Workspace.Ores.Ores5 then animTrack = plr.Character.Humanoid:LoadAnimation(animation) animTrack:Play() else print("not a brick xD") end end)
heres the error:
02:26:02.999 - Unable to cast value to Object 02:26:03.000 - Script 'Players.Player.PlayerGui.LocalScript', Line 7 02:26:03.002 - Stack End |
|
|
| Report Abuse |
|
|
error9999
|
  |
| Joined: 05 Sep 2009 |
| Total Posts: 1593 |
|
|
| 25 Dec 2014 05:22 AM |
if mouse.Target.Parent == game.Workspace.Ores then
Now it will work for all ores c: |
|
|
| Report Abuse |
|
|
| |
|