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??
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??
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.
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.
Or you could do this.
while true do
pcall(function()
Workspace.PartName:Destroy()
end)
end
You're just asking for a script, dude.
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
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.
Then you want to add the instance where it changes the leaderboard stats after the player has touched it and it disappears.
is there a way to make it respawn, say after they pass the map, and they come back to it??
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()