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

My gui will only show for one player, why is that?

Asked by 11 years ago

I want this gui to show for all players, for some reason it is only showing on one players screen. My guess is that it is something to do with the variables being reassigned before the script has a chance to run through or something like that?

**UPDATED SCRIPT THANKS TO HELP FROM chararray256 **

01function mem(v)
02    print(1)
03    coroutine.wrap(function()  
04        print(2)
05        repeat wait() print("waiting") until v:FindFirstChild("PlayerGui")
06        gui = v:FindFirstChild("PlayerGui").Loading.d
07        print(3)
08        wait()
09        gui.Image = "http://www.roblox.com/asset/?id=154661376"
10        gui.Visible = true
11        print(4)
12        for i = 1,10 do
13            for a,b in pairs(introGuis) do
14                print("try")
15                gui.Image = "http://www.roblox.com/asset/?id=" .. b
View all 22 lines...

3 answers

Log in to vote
1
Answered by
gskw 1046 Moderation Voter
11 years ago

Try this:

01function GiveGui(v)
02    print(1)
03    coroutine.wrap(function()  
04        print(2)
05        repeat wait() print("waiting") until v:FindFirstChild("PlayerGui")
06        gui = v:FindFirstChild("PlayerGui").Loading.d
07        print(3)
08        wait()
09        gui.Image = "http://www.roblox.com/asset/?id=154661376"
10        gui.Visible = true
11        print(4)
12        for i = 1,10 do
13            for a,b in pairs(introGuis) do
14                print("try")
15                gui.Image = "http://www.roblox.com/asset/?id=" .. b
View all 24 lines...

Your script didn't work because it was ran only once, when the server was started.

0
This isn't the full script, it is midway down the real script. And how will making it a function help, out of curiosity (could you explain your change) crackabottle123 110 — 11y
0
I made the function connected to the PlayerAdded event. I made it a function to not have to write it twice (in the for loop and the connect() method.) gskw 1046 — 11y
0
Thankyou for your answer, but one last question . Why is the playeradded there in the first place? Is it really necessary (I dont want it run on playeradded, just to all players at a certain time which is done using the for loop you provided) crackabottle123 110 — 11y
0
It is neccessary as the for loop runs only once, when the server is started. I made it work so a player gets the GUI when they join as it seems you want it to work so. gskw 1046 — 11y
View all comments (3 more)
0
Still does not work, I put my co-routine into a function then called it with a for loop using "v" as the argument, that way the function ran for each person BUT still only one person received the GUI crackabottle123 110 — 11y
0
If it is in a LocalScript, put it in a regular script. gskw 1046 — 11y
0
Sorry! It works! Thankyou so much! crackabottle123 110 — 11y
Ad
Log in to vote
0
Answered by 11 years ago

I read somewhere that "if it's placed in a PlayerGui then it will display to one person but if it's placed in workspace then it will display to everyone

0
But I am accessing everyones playergui, for that exact reason. crackabottle123 110 — 11y
Log in to vote
0
Answered by 11 years ago

Just make the actual Gui and put it in Starter Gui.

Answer this question