so i dont want anyone to write me a script or animate anything, im just wondering it is possible.
k so ive got this script
script.Parent.ClickDetector.MouseClick:connect(function(player) local leftMouseDown = true player:GetMouse().Button1Up:connect(function() leftMouseDown = false end) wait(1) while leftMouseDown do player.leaderstats.Gold.Value = player.leaderstats.Gold.Value + 10 wait(1) end end)
would it be possible to within the
while leftMouseDown do player.leaderstats.Gold.Value = player.leaderstats.Gold.Value + 10 wait(1) end
Part add a player animation. ill explain
this is going to be a very basic fishing system and it works by holding your mouse button down on the fishing hole. and im wanting to to play an animation of holding a pole, i can make the animation and such but im wondering if this is even possible to do b4 i try.
Once you have the Animation you can Play it like so:
animationTrack = player.Character.Humanoid:LoadAnimation(*Enter Animation Instance Here*) animationTrack:Play()
You could have the Animation Instance located in the script (I.E have the script as its Parent) You can then play it like so:
animationTrack = player.Character.Humanoid:LoadAnimation(script.FishingAnimation) animationTrack:Play()
So, yes it is possible. The "LoadAnimation" function returns an "AnimationTrack" object which you can then play.
http://wiki.roblox.com/index.php?title=API:Class/AnimationTrack http://wiki.roblox.com/index.php?title=API:Class/Humanoid