I made an animation of equip, shoot, and unequip for a game, this is the script:
01 | local tool = script.Parent |
02 | local handle = tool.Handle |
03 | local player = game.Players.LocalPlayer |
04 | local char = player.Character |
05 |
06 | script.Parent.Equipped:connect( function (eventMouse) |
07 | eventMouse.Icon = "http://www.roblox.com/asset/?id=316279304" |
08 | local animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Equip) |
09 | animation:Play() |
10 | end ) |
11 |
12 | script.Parent.Activated:connect( function () |
13 | local animation 2 = player.Character.Humanoid:LoadAnimation(script.Parent.Start) |
14 | animation 2 :Play() |
15 | local mouse = player:GetMouse() |
but the tool doesnt appear at the time of that animation, this is problem https://gyazo.com/d7eabff9d44357b5b42a25fbc7babe97 i want it to appear when u taken it out, same for unequip, tool disappears quickly than animation
A lot of people would probably do this in some other way, but here's my suggestion. Try defining all of the parts that make your tool, and set their transparency to 1, after that make the transparency of all parts 0 again inside the script in the line under your equip animation:Play(). Make sure to put a wait() in between those, make it wait for the duration of the equipping animation.
For the unequipping one, try cloning all the tool parts, and welding them to the hand(without them having anything inside them) set their transparency to 1. Make the transparency 0 under the Unequipped() function. Add a wait() after with the duration of the animation inside it, and make the transparency 1 again.