When I make my scripts they all seem to need me to disable then enable then in the explorer properties thing please help. Even if I do what I would consider a good code it still does it like this one I made.
local brick = game.Workspace.Brick function onTouch(part) brick.Transparency = 1 wait(1) brick.Transparency = 0 end brick.Touched:connect(onTouch)
Changing the source of a script means absolutely nothing if its old code is already running. One solution if you don't want to disable and enable is to stop writing when the world is currently being simulated.
Why are you calling the variable "brick" inside your function when you have already an argument called "part" that passes your brick? Change this:
function onTouch(part) brick.Transparency = 1 wait(1) brick.Transparency = 0 end
to this:
function onTouch(part) part.Transparency = 1 wait(1) part.Transparency = 0 end