I don't know how to play an animation when RMB is activated/ clicked. Please help. Thank you! <3
01 | --LocalScript |
02 | local plr = game.Players.LocalPlayer; |
03 | local mouse = plr:GetMouse() --we got the mouse |
04 | local ID = "put id of animation here" --make sure you only put the numbers |
05 |
06 | mouse.Button 2 Up:Connect( function () --When we right click |
07 | local anim = Instance.new( "Animation" ) --makes an animation |
08 | anim.AnimationId = "rbxassetid" .. tostring (ID) --sets the ID |
09 | local track = plr.Character.Humanoid:LoadAnimation(anim) --loads the track to the player's humanoid |
10 | track:Play() --plays the animation |
11 | end ) |
Please make an attempt to solve your problem, this isn't a request site.