Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Scrip in StarterGUI isnt working?

so this is a script inside a frame that's inside a GUI and that GUI is inside a StarterGUI. The script makes it so if you touch one part, a GUI appears, but if you touch another part then the GUI disappears (or at least the text) The 1st part of the script works, but the 2nd part doesn't. any help?

local Part = workspace:FindFirstChild("Why")

Part.Touched:Connect(function(PartThatTouchedThePart)

wait(1)

  

script.Parent.Text.TextTransparency = 0

  

script.Parent.Text2.TextTransparency = 0

end)

  

local Part = workspace:FindFirstChild("PIZZA")

Part.Touched:Connect(function(PartThatTouchedThePart)

wait(1)

  

script.Parent.Text.TextTransparency = 1

  

script.Parent.Text2.TextTransparency = 1

print("NYEAH!")

end)

1 answer

✓ Accepted answer

you only tell the script to make the text invisible, instead of doing that you should make the gui invisible(the text will be invisible too) by typing the following

local Part = workspace:FindFirstChild("Why")

Part.Touched:Connect(function(hit)
if hit:FindFirstChild("Humanoid") then--this will see if u have touched the part

wait(1)

  

script.Parent.Parent.Enabled= false--this will make the gui invisible and not active
end

  

end)

  

local Part = workspace:FindFirstChild("PIZZA")

Part.Touched:Connect(function(hit)
if hit:FindFirstChild("Humanoid") then

wait(1)

  

script.Parent.Parent.Enabled= true--this will make the gui visible and active

  

print("NYEAH!")
end

end)

1 comment

0

tried it out and it worked! thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.