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!
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)
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)
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)