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

How do I make a Block I placed disappear?

Asked by 3 years ago

I made a block placing script where the player can place a part, but the part just stays there forever! I need to make it so that the part will disappear after let's say 10 seconds, I have tried so many ways and non of them work, I really am stumped and require help

function place()
    p = Instance.new("Part")
    p.Parent = game.Workspace
    p.Name = game.Players.LocalPlayer.Name
    p.BrickColor = game.Players.LocalPlayer.PlayerGui.Vectors.Color.Value
    if game.Players.LocalPlayer.PlayerGui.Vectors.Anchor.Value == 1 then
        p.Anchored = true
    elseif game.Players.LocalPlayer.PlayerGui.Vectors.Anchor.Value == 0 then
        p.Anchored = false
    end
    p.Size = game.Players.LocalPlayer.PlayerGui.Vectors.VValue.Value
    p.Position = game.Players.LocalPlayer.Character.Humanoid.TargetPoint
end

script.Parent.Activated:connect(place)
1
Have you tried using wait(10) p:Remove()? if not, try p.Parent = nil CocoDysphoria 67 — 3y
1
Remove() is deprecated boy...... What year do you live on??????? Xapelize 2658 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
wait(10)
p:Destroy()

Is that what you're trying to do? It destroys the part after 10 seconds.

0
It works, for the first block but every block i place after that stays, like the first block i place goes away but the second third fourth etc don't, i need them all do disappear after like 10 seconds DanDan_Potato 0 — 3y
0
Okay, can you show your script and where you included this piece Omq_ItzJasmin 666 — 3y
0
Also you should be putting it somewhere like between lines 12 and 13 Omq_ItzJasmin 666 — 3y
Ad

Answer this question