generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Animation

Previous Thread :: Next Thread 
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
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 is not online. 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
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
24 Dec 2014 05:01 PM
?
Report Abuse
Funse is not online. Funse
Joined: 11 Jun 2012
Total Posts: 7887
24 Dec 2014 05:01 PM
Player animations should be used with local scripts.
Report Abuse
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
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
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
24 Dec 2014 05:07 PM
b
Report Abuse
Funse is not online. 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
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
24 Dec 2014 05:38 PM
Thx, so i put the local script in starter Gear?
Report Abuse
Funse is not online. 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 is not online. error9999
Joined: 05 Sep 2009
Total Posts: 1593
24 Dec 2014 05:40 PM
StarterGui c:
Report Abuse
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
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
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
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 is not online. 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
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
26 Dec 2014 09:04 PM
dont work
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image