Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how do you make a block dissapear forever when you touch it?

im trying to make a block dissapear forever on the server when a player touches it. ive looked at a lot of different video tutorials and none of them worked. this is my code:

function onTouched(playerWhoTouched) wait(.3) script.Parent.Transparency=1 script.Parent.CanCollide=false

end

thanks from poopypigeon245

2 answers

✓ Accepted answer

I may be wrong because I am a beginner.

You haven't defined what is being touched to call the function.

The way I would do it.

script.Parent.Touched:connect(function()
	wait(3)
	script.Parent:Destroy()
end)

:Destroy() is a much better thing to use for what you're trying to do.

1 comment

0

thanks :D

script.Parent.Touched:connect(function()
script.Parent:Remove()
end)

You should use a more simple function e.g

script.Parent.Touched:connect(function()
end)

And try learn the basics of scripting.

This discussion is preserved as it was. New answers, comments, and votes are closed.