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

PlayerAdded Event GUI popup doesn't work, Why?

I am now working on that a player joins the game and a GUI/UI will popup, but it doesn't work..

Here's the code

local Players = game:GetService("Players")
local Main = game.StarterGui.Menu.Main


function playerAdded(player)
	Main.Visible = true	
	print("hey its ur boi testing")
end
game.Players.PlayerAdded:Connect(playerAdded)

and btw It doesn't even print it. + There is no errors

4 comments

0

is this a local script?

0

this is a server script in a GUI https://gyazo.com/f31969efd132000d39478f3e55d9531a

0

what is menu,is it a screen gui?

0

i know what is the problem check out my answer

2 answers

✓ Accepted answer
local Players = game:GetService("Players")
local Main = game.StarterGui.Menu.Main--this is the gui that is in starter gui but not what is in the players gui

--starter gui is a service that clones all what is in it o the player that joined so if you are making it visible its not making the clones it just make what is in starter gui visible


--this should work
function playerAdded(player)
    player.PlayerGui.Menu.Main.Visible = true
    print("hey its ur boi testing")
end
game.Players.PlayerAdded:Connect(playerAdded)
local Players = game:GetService("Players")
local Main = game.StarterGui.Menu.Main


function playerAdded(player)
    player.PlayerGui.Menu.Main.Visible = true
    print("hey its ur boi testing")
end
game.Players.PlayerAdded:Connect(playerAdded)

Try this it might not work but it doesnt know what Main.Visible is so referencing Gui will fix it I think sorry if It doesnt work ill find other solution.

1 comment

0

Main is the frame

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