usi = game:GetService("UserInputService")
plr = game.Players.LocalPlayer
char = plr.Character
debris = game:GetService("Debris")
usi.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.X then
animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://7050119585"
animation.Parent = plr
debris:AddItem(animation,2)
load = game.Workspace[game.Players.LocalPlayer.Name].Humanoid:LoadAnimation(animation):Play()
wait(.15)
explosion = Instance.new("Explosion")
explosion.Parent = workspace
explosion.DestroyJointRadiusPercent = 0
explosion.Position = game.Players.LocalPlayer.Character.RightHand.Position + (Vector3.new(50,0,0) * game.Players.LocalPlayer.Character.RightHand.CFrame.LookVector)
end
end)
Im trying to make a explosion appear in front of player's hand when he press x. But almost everytime the explosion goes another way (i dont think this problem is because of the animation).
