Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I want a part(x) to appear in my hand when I play an animation?

I want a part(x) to appear in my hand when I play an animation.Here is my code, thanks. Player = game.Players.LocalPlayer Mouse = Player:GetMouse() animation = script:WaitForChild("Animation")

Mouse.KeyDown:connect(function(key)
key = key:lower()
 if key == "q" then
	local animationTack = Player.Character.Humanoid:LoadAnimation(animation)
	animationTack:Play()
	wait(3.2)
	animationTack:Stop()
	wait(.3)
    local x = Instance.new("Part")
	x.Shape = "Ball"
	x.Material = "Neon"
    x.BrickColor = BrickColor.new("Bright red")
    x.TopSurface = "Smooth"
    x.BottomSurface = "Smooth"
    x.CanCollide = false
    x.Anchored = false
    x.CFrame = Player.Character.RightHand.CFrame * CFrame.new(0,0,-2)
    local v = Instance.new("BodyVelocity", x)
    v.velocity = Player.Character.Head.CFrame.lookVector * 90
    v.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  x.Parent = workspace
  wait(10)
    x:remove() 
      end
  
end)

4 comments

0

Use a code block..

0

i did

0

remove is depricated use Destroy

0

connect and keyDown are also depricated

1 answer

Try creating a part called Handle and make you character equip it. You made a instance new right, but you should add a handle like x.Name = Handle local y = Instance.new("Tool") y.Name = AnimationTool y.Parent = game.Lighting and now the thing that will equip you the tool game.Players.LocalPlayer.Character.Humanoid:EquipTool(game.Lighting.AnimationTool) I dont know if this is right /
I

This discussion is preserved as it was. New answers, comments, and votes are closed.