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

This function isn't firing? [SOLVED]

Well, I'm making a "Starting GUI" to fire when a player joins a game. It doesn't seem to be working at all.

Function that doesn't fire:

game.Players.PlayerAdded(function(player)
	wait(5) --waiting for player
	welcome:clone().Parent = player.PlayerGui
	print('eurika!')
	welcome.one.msg.Text = "Welcome "..player.Name.."to Ro-Warfare"
	wait(5)

All Code:

-- ==================LOCAL_TAGS==================== --

local l = game.Lighting
local w = game.Workspace
local g = game.StarterGui
local welcome = game.Lighting.WelcomeGui
local admins = {"BlackKnightXx", "InfinitySoldier"}

-- ==================MAIN_SCRIPT=================== --

game.Players.PlayerAdded(function(player)
	wait(5) --waiting for player
	welcome:clone().Parent = player.PlayerGui
	print('eurika!')
	welcome.one.msg.Text = "Welcome "..player.Name.."to Ro-Warfare"
	wait(5)
	for i = 1,5 do
		wait(0.5)
		welcome.one.msg.Text = "Loading Player."
		wait(0.5)
		welcome.one.msg.Text = "Loading Player.."
		wait(0.5)
		welcome.one.msg.Text = "Loading Player..."
		wait(0.5)
		welcome.one.msg.Text = "Loading Player.."
	end
	wait()
	for i = 1,5 do
		wait(0.5)
		welcome.one.msg.Text = "Loading Character."
		wait(0.5)
		welcome.one.msg.Text = "Loading Character.."
		wait(0.5)
		welcome.one.msg.Text = "Loading Character..."
		wait(0.5)
		welcome.one.msg.Text = "Loading Character.."
	end
	wait()
	local char = player.Character
	for i = 1,5 do
		wait(0.5)
		welcome.one.msg.Text = "Loading Maps."
		wait(0.5)
		welcome.one.msg.Text = "Loading Maps.."
		wait(0.5)
		welcome.one.msg.Text = "Loading Maps..."
		wait(0.5)
		welcome.one.msg.Text = "Loading Maps.."
	end
	wait()
	local maps = l.Maps
	welcome.one.msg.Text = "Done Loading!"
	wait(3)
	welcome:Destroy()
	
end)

1 answer

✓ Accepted answer

Well of course its not firing. You typed it wrong.

game.Players.PlayerAdded:connect(function(player) -- Added :connect. ALWAYS add connect!
    wait(5) --waiting for player
    welcome:clone().Parent = player.PlayerGui
    print('eurika!')
    welcome.one.msg.Text = "Welcome "..player.Name.."to Ro-Warfare"
    wait(5)



Also, i'd advice you not to put the list of your admins in a local variable...

1 comment

0

Oh my God, thank you so much; I didn't realize I was missing the ":connect", lol. Thanks! :D

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