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

How to make an object disappear forever?

Asked by 10 years ago

How can I make an object disappear after I tocuh it?

Something like the coins in deathrun is what I'm aiming for?

P.S I can edit the script and all that, just need to base of the script done

Hope you can help??

4 answers

Log in to vote
0
Answered by 10 years ago

Er, best way is the 'Destroy' function. Place the following script in your part.

script.Parent.Touched:connect(function (hit)
    if not hit.Parent:findFirstChild("Humanoid") then return end
    hit:Destroy()
end)

Note, after this it is NOT POSSIBLE in ANY WAY to get the part back, other then making another part via Instance.new(). If I helped, give me a rep point please.

Ad
Log in to vote
1
Answered by 10 years ago

if you are aiming for a coin-like model, one of the simplest ways to preform an action like this is to start with an onTouch() that makes the player the parent of the object with which to then remove it once the object is in the players model, which you could then remove it like a basic limb. I would write you the code but it is extremely late and I'm cramming. Sorry.

0
Yeah, Im aiming for a coin I want in an RPG im making. If you have ever played Deathrun 2 then youll see the coin when you get it, It gives you 1 coin in the leaderboard and it disappears. NinjoOnline 1146 — 10y
1
Then you want to add the instance where it changes the leaderboard stats after the player has touched it and it disappears. areiydenfan00 115 — 10y
0
is there a way to make it respawn, say after they pass the map, and they come back to it?? NinjoOnline 1146 — 10y
1
if you are wanting to remove it, which I think you are (if not you could turn it invisible and make it wait at least x amount of time before it "respawns" and is worth points), then you have to create a new instance for it using instance.new() areiydenfan00 115 — 10y
Log in to vote
0
Answered by 10 years ago

Or you could do this.

while true do
pcall(function()
Workspace.PartName:Destroy()
end)
end
Log in to vote
0
Answered by 10 years ago

You're just asking for a script, dude.

Answer this question