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

How do I make a decal removed when it is touched?

Asked by 10 years ago

So I want to make it so that when I touch a brick, that decal will be removed. How could I make it do that? So far I have tried this.

local brick = Workspace.Brick

function onTouch(part) script.Parent:Remove() end

2 answers

Log in to vote
2
Answered by 10 years ago
function Touched()
script.Parent.Decal:remove()
end
script.Parent.Touched:connect(Touched)

Insert this script inside of the brick with the decal. Good job you a beginner scripter! Many people just request scripts but you attempted before you asked! I See a good scripter in the future and his name is awesome9944!

Ad
Log in to vote
1
Answered by 10 years ago
function onHit (player)
script.Parent.Decal = nil
end
script.Parent.Hit:connect(onHit)

Answer this question