function onTouched(Brick) Brick = script.Parent game.Workspace.Brick.Transparency = 1 wait(1) game.Workspace.Brick.Transparency = 0 game.Workspace.Brick.Name = Worked end if game.Workspace.Brick.Name==Worked then print("Worked! :D") end
What is the problem here, It's supposed to make a brick go transparent then become nontransparent if you touch it.
script.Parent.Touched:connect(function(hit) if hit.Parent and game.Players:GetPlayerFromCharacter(hit.Parent) then game.Workspace.Brick.Transparency = 1 wait(1) game.Workspace.Brick.Transparency = 0 game.Workspace.Brick.Name = 'Worked' end if game.Workspace.Brick.Name=="Worked" then end print("Worked! :D") end)
You have to have quotations so:
function onTouched(Brick) Brick = script.Parent game.Workspace.Brick.Transparency = 1 wait(1) game.Workspace.Brick.Transparency = 0 game.Workspace.Brick.Name = "Worked" end if game.Workspace.Brick.Name == "Worked" then print("Worked! :D") end
or you could do this and be able to change it to what ever
Worked = "Worked" function onTouched(Brick) Brick = script.Parent game.Workspace.Brick.Transparency = 1 wait(1) game.Workspace.Brick.Transparency = 0 game.Workspace.Brick.Name = Worked end if game.Workspace.Brick.Name==Worked then print("Worked! :D") end