I'm trying to make a "button" that, when stepped on, causes another invisible platform to appear. I'm attempting to use a global variable to make it work, but I can't seem to get it. I've pasted the code from my two parts below:
Invisible block:
local visibility = game.Workspace.Platform.Transparency
local Platform = game.Workspace.Platform
local transparent = true
function isTouched()
print("hello")
transparent = false
game.Workspace.Platform.Transparency = 0
wait(1)
game.Workspace.Platform.Transparency = 1
end
game.Workspace.Platform.Touched:Connect(isTouched)
while transparent == true do
game.Workspace.Platform.Transparency = 1
end
while _G.activated == true do
print("On")
game.Workspace.Platform.Transparency = 0
end
Button:
_G.activated = false
function isTouched()
print("hi")
_G.activated = true
wait(1)
_G.activated = false
end
game.Workspace.Button.Touched:Connect(isTouched)
any advice would be appreciated. Thanks!
