[I need a fix] How do i make a script which can make a decal transparent when i touch it, similar to "Guess the Logo Quiz for Admin."

So i am currently working on a Roblox game and i am not able to make a decal transparent when i touch it. When i touch a block it disappears (transparency down with collision off) but it’s decal doesn’t.

I have tried this script on the decal :
–script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) then
script.Parent.Transparency = 0.7
end
end)–

but it didn’t work so i hope someone helps me and help me find a fix!

1 Like

wait im sorry this the correct one

local Part = game.Workspace.GuessParts -- Replace with the actual folder containing your parts
local Debounce = false

Part.Touched:Connect(function(hit)
    local hum = hit.Parent:FindFirstChild("Humanoid")
    if hum and not Debounce then
        Debounce = true
        for _, v in pairs(Part:GetDescendants()) do
            task.spawn(function()
                v.Transparency = 0.7
                v.CanCollide = false
                task.wait(10)
                v.Transparency = 0
                v.CanCollide = true
            end)
        end
        Debounce = false
    end
end)

1 Like

Going to test it right now! Hopefully it works.

1 Like

local db,part=true,script.Parent
part.Touched:Connect(function(hit)
	if db and hit.Parent:FindFirstChildOfClass("Humanoid") then
		db=false part.Decal.Transparency = 1	
	end
end)
2 Likes

Im still didn’t find a fix, if someone can help me with some explanation it will be very great!

1 Like

You change the Transparency value of the decal not the part it’s in …

Do i put the script inside the decal or inside the part it’s in or in a folder or model?

inside the part

local db = true
local part = script.Parent
part.Touched:Connect(function(hit)
	if db and hit.Parent:FindFirstChildOfClass("Humanoid") then
       part.Decal.Transparency = 1 -- transparent
       db = false -- stops it from running again
	end
end)

a one time switch

Closed, i actually didn’t needed to make the decal transparent.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.