I am sorry for my bad explaining here:
I have a Script Which will Show An Gui. I've set Visible to false on properties
The problem is that the gui wont show up when i touch the part.
Heres the script:
01 | local parent = script.Parent |
02 | local Gui 1 = game.StarterGui.WelcomeScene.Text 1 |
03 |
04 | parent.Touched:Connect( function () |
05 | parent.CanCollide = false |
06 | print ( "Starting['welcomeScene']" ) |
07 | Gui 1. Visible = true |
08 | wait( 2 ) |
09 | Gui 1. Visible = false |
10 | end ) |
When i check the Output there is no errors. Is there anyone that know how to fix this? (or is my studio glitched)
First, you forgot the debounce variables, and you're doing it incorrect, second, make sure WelcomeScene is visible as well, and use PlayerGui so it's visible for only the person who touched it. Also, make sure script.Parent is the part.
Code:
01 | local debounce = false |
02 | script.Parent.Touched:Connect( |
03 | function (hit) |
04 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
05 | if player then |
06 | local WelcomeScene = player.PlayerGui.WelcomeScene |
07 | if debounce = = false then |
08 | debounce = true |
09 | parent.CanCollide = false |
10 | print ( "Starting WelcomeScene" ) |
11 |
12 | WelcomeScene.Enabled = true |
13 | WelcomeScene.Text 1. Visible = true |
14 | wait( 2 ) |
15 | WelcomeScene.Enabled = false |