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

How would you make a part come out of the torso, when killed?

Asked by 7 years ago
local character = workspace.Enemies.Gem

character:WaitForChild("Humanoid").Died:connect(function() --waitforchild to make sure its there
    redgem = Instance.new("Part",game.Workspace.GemDropStorage)
    redgem.Size = Vector3.new(1,1,1)
    redgem.Material = "Neon"
    redgem.BrickColor = BrickColor.new("Really red")
    redgem.Position = game.Workspace.Enemies.Gem.Torso
end)

I want the part to come out of its torso when killed, not at a certain cordinates? How would i do this. It would also be helpful in the future

1 answer

Log in to vote
0
Answered by
Corexty 15
7 years ago
local character=workspace.Enemies.Gem

character:WaitForChild("Humanoid").Died:connect(function()
    local redgem=Instance.new("Part",workspace.GemDropStorage)
    redgem.Size=Vector3.new(1,1,1)
    redgem.Material=Enum.Material.Neon
    redgem.BrickColor=BrickColor.new("Really red")
    redgem.CFrame=game.Workspace.Enemies.Gem.Torso.CFrame
end)
Ad

Answer this question