Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Announcer Still Not Working?

Asked by 9 years ago

I am trying to create a script that when a certain person enters the game an Audio and a GUI Pops up... For some reason it wont work! There is no error in script or output. So what do I do?

01PersonScreen = game.StarterGui.Screen.PersonScreen
02Next = script.NextTime
03Trum = script.Trumpets
04function OnPlayerEntered(player)
05if player.userId == game.CreatorId then
06    PersonScreen.Visible = true
07    Next.Play()
08    wait(7)
09    PersonScreen.Visible = false
10    wait(8)
11    Next.Stop()
12else   
13if player.userId ==  17776158 then
14    PersonScreen.Text = "ActuallyConnor Joined The Game!"
15    PersonScreen.Visible = true
View all 23 lines...

2 answers

Log in to vote
1
Answered by 9 years ago
01Next = script.NextTime
02Trum = script.Trumpets
03function OnPlayerEntered(player)
04if player.userId == game.CreatorId then
05        for _,v in pairs (game.Players:GetPlayers()) do
06            PersonScreen = v:WaitForChild("PlayerGui").Screen.PersonScreen
07            PersonScreen.Text = "ActuallyConnor Joined The Game!"
08            PersonScreen.Visible = true
09        end
10    Next:Play()
11    wait(7)
12        for _,v in pairs (game.Players:GetPlayers()) do
13            PersonScreen = v:WaitForChild("PlayerGui").Screen.PersonScreen
14            PersonScreen.Visible = false
15        end
View all 37 lines...

Basically, the for loops get each player in players and changes the gui manually.

0
Didnt Wrok :/ TayLife12 69 — 9y
0
Output? HungryJaffer 1246 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

You need to have the connect function

01PersonScreen = game.StarterGui.Screen.PersonScreen
02Next = script.NextTime
03Trum = script.Trumpets
04function OnPlayerEntered(player)
05if player.userId == game.CreatorId then
06    PersonScreen.Visible = true
07    Next.Play()
08    wait(7)
09    PersonScreen.Visible = false
10    wait(8)
11    Next.Stop()
12else  
13if player.userId ==  17776158 then
14    PersonScreen.Text = "ActuallyConnor Joined The Game!"
15    PersonScreen.Visible = true
View all 24 lines...
0
It Now Says In The Output "attempt to call a nil value" TayLife12 69 — 9y
0
Which line? ADeadlyGuest4 62 — 9y
0
Doesnt tell TayLife12 69 — 9y
0
after the word script it should say the number ADeadlyGuest4 62 — 9y
View all comments (2 more)
0
This is what it says "17:37:01.388 - attempt to call a nil value" TayLife12 69 — 9y
0
Ok Now It Doesn't say it in Studio It was another script, but its still not working in -game. Should I put it in local script? TayLife12 69 — 9y

Answer this question