Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Part not moving to the position of the dead enemy's torso? Im using Vector3 to move it?

Asked by 4 years ago
Edited 4 years ago

So, when the enemy's health reaches 0, it generates some numbers to decide what to spawn and which. I have 4 of these, which different numbers. The ammo will spawn, way to the side of the map, with nothing there, just fall and delete itself. Is there a different way to move it, because of im pretty sure it's not.

if num2 == 1 then
            local Pistol = game.Lighting.Ammo.PistolAmmo:Clone()
            Pistol.Parent = workspace
            Pistol.Position = Vector3.new(script.Parent.LowerTorso)
            end

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago
if num2 == 1 then
            local Pistol = game.Lighting.Ammo.PistolAmmo:Clone()
            Pistol.Parent = workspace
            Pistol.Position = Vector3.new(script.Parent.LowerTorso.Position.X, script.Parent.LowerTorso.Position.Y, script.Parent.LowerTorso.Position.Z)
            end

make sure its R15 if ur using lower torso, if not, use torso or humanoidrootpart

You can also use

if num2 == 1 then
            local Pistol = game.Lighting.Ammo.PistolAmmo:Clone()
            Pistol.Parent = workspace
            Pistol.Position = script.Parent.LowerTorso.Position
            end
0
Thank you, the first one works great!! zandefear4 90 — 4y
0
No problem. AcrylixDev 119 — 4y
Ad

Answer this question