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

How to make Decal dissapear on part touch script?

Asked by 2 years ago

Hello. I am really new at scripting and I need an script that instantly sets decal transparency to 1 after a player touches the part that the Decal is on. Any help?

1 answer

Log in to vote
0
Answered by 2 years ago

Hi! I made a script for you. You have to put the script inside the part, and the decal inside the same part. Script:

local Decal = script.Parent.Decal --You can change variable if you want

script.Parent.Touched:Connect(function(hit) --Function touched
    if hit.Parent:FindFirstChild("Humanoid") then --Confirm if the object that touches the part is a player
        Decal.Transparency = 1 --Transform decal transparency to 1 (invisible)
    end
end)

If you have a question, let me know. I hope it helped you!

Ad

Answer this question