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

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

Asked by 7 years ago

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

Log in to vote
0
Answered by 7 years ago

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.

0
thanks :D poopypigeon245 22 — 7y
Ad
Log in to vote
0
Answered by
Prestory 1395 Moderation Voter
7 years ago
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.

Answer this question