local debounce = true
script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and hit.Parent:FindFirstChild("Humanoid") then
if debounce then
debounce = false
while script.Parent.Transparency <= 1 do
script.Parent.Transparency = script.Parent.Transparency + 0.01
wait(0.01)
end
script.Parent.CanCollide = false
wait(3)
script.Parent.CanCollide = true
script.Parent.Transparency = 0
debounce = true
end
end
end)
Local scripts don't work in workspace, so you can't put this script in there. I can't seem to find any idea to solve it.

17 comments
FOR SAKE U CANT GET PLAYER WITH :GETPLAYERFROMCHARACTER This is a local script ok? also you are right the local script should be parented to something related to the player
There will be multiple bricks, am I right?
Tnt yes you can
You don't want to put so many scripts for each brick
But then again you could use a for loop
You absolutely right, I didn't account for that I'll post another.
There, now it's fixed.
I normally don't use ipairs, I just use pairs
And if you change the script.Parent s to v then ill accept your answer
LOL i'm stupid
hm its still not local
What isn't
the fading
The fading isn't working?
Bruh I thought the fading worked so I didn't touch that part
The fading works fine, I just checked the script
Yeah, the fading is local