Why wont my scripts wait? There doesnt seem to be anything wrong
Asked by
3 years ago Edited 3 years ago
OK so. the problem here is that I tell my scripts to wait a bit and then do something but they do nothing and stay as what I set them to in their properties for the guis and the scripts just don't listen here is all the script code
one of the scripts
02 | local cscript = script:WaitForChild( "CutsceneScript" ) |
03 | if script:findFirstChild( "SkipCutsceneGuiValue" ) then |
04 | script.SkipCutsceneGuiValue.Parent = cscript |
05 | script.SkipCutsceneGui.Parent = cscript |
08 | function onPlayerEntered(player) |
09 | repeat wait () until player.Character |
10 | local new_script = script.CutsceneScript:clone() |
11 | new_script.Parent = player.Character |
12 | new_script.Disabled = false |
15 | game.Players.PlayerAdded:connect(onPlayerEntered) |
16 | onPlayerEntered(game.Players:WaitForChild( "Player1" )) |
another one
5 | script.DeathSound:Play() |
still more
2 | script.parent.visible = true |
4 | script.parent.visible = false |
again
2 | script.parent.visible = false |
same code i used for two scripts
2 | script.parent.visible = false |