NorBenek
(MrYoink)
May 2, 2024, 2:33pm
#1
OK, so whenever I press the GUI button for the 3rd time, it just disappears.
It’s a maze optimization script. Basically means it changes the map/maze every time when the button is clicked. (On the players screen not server).
Script:
script.Parent.tMaze.MouseButton1Click:Connect(function()
game.Workspace:FindFirstChild("OriginalMaze").Parent = game.Lighting
game.Lighting:FindFirstChild("SecondMaze").Parent = game.Workspace
script.Parent.tMaze.Visible = false
script.Parent.dMaze.Visible = true
script.Parent.clicksound:Play()
end)
script.Parent.dMaze.MouseButton1Click:Connect(function()
game.Workspace:FindFirstChild("SecondMaze").Parent = game.Lighting
game.Lighting:FindFirstChild("OriginalMaze").Parent = game.Workspace
script.Parent.tMaze.Visible = true
script.Parent.dMaze.Visible = false
script.Parent.clicksound:Play()
end)
Could you specify which gui button disappears?
tMaze
or dMaze
?
NorBenek
(MrYoink)
May 2, 2024, 2:39pm
#3
I’m pretty sure it’s dMaze and tMaze both.
Is the visibility of the dMaze Button changing by another script?
NorBenek
(MrYoink)
May 2, 2024, 2:42pm
#5
Nope it’s only 1 and it’s this one. ( It’s a Local script btw).
Milk_Koun
(Skey TheRabbit)
May 2, 2024, 2:44pm
#6
You clicking on buttons like: tMaze → dMaze → tMaze and have you errors in your output console?
Hmm… I tested the scripts
without
game.Workspace:FindFirstChild("OriginalMaze").Parent = game.Lighting
game.Lighting:FindFirstChild("SecondMaze").Parent = game.Workspace
game.Workspace:FindFirstChild("SecondMaze").Parent = game.Lighting
game.Lighting:FindFirstChild("OriginalMaze").Parent = game.Workspace
and I didn’t face any problems.
So maybe the problem happens with parenting the Mazes.
Maybe Instead of changing their parents clone them to Workspace.
1 Like
Milk_Koun
(Skey TheRabbit)
May 2, 2024, 2:47pm
#8
local OM = game.Workspace:FindFirstChild("OriginalMaze")
local SM = game.Lighting:FindFirstChild("SecondMaze")
script.Parent.tMaze.MouseButton1Click:Connect(function()
OM.Parent = game.Lighting
SM.Parent = game.Workspace
script.Parent.tMaze.Visible = false
script.Parent.dMaze.Visible = true
script.Parent.clicksound:Play()
end)
script.Parent.dMaze.MouseButton1Click:Connect(function()
SM.Parent = game.Lighting
OM.Parent = game.Workspace
script.Parent.tMaze.Visible = true
script.Parent.dMaze.Visible = false
script.Parent.clicksound:Play()
end)
And i rec you make like this for not searching those mazes in workspace
NorBenek
(MrYoink)
May 2, 2024, 2:50pm
#9
Never mind, it was my fault lol. Turns out the tMaze’s transparency was set to 1. Therefore I couldn’t see it. I sincerely apologize for my stupidity. Thanks for helping though!
3 Likes
system
(system)
Closed
May 16, 2024, 2:51pm
#10
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.