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

This function isn't firing? [SOLVED] [closed]

Asked by 10 years ago

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)

Locked by Shawnyg and AmericanStripes

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
1
Answered by 10 years ago

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...

0
Oh my God, thank you so much; I didn't realize I was missing the ":connect", lol. Thanks! :D keitheroni 45 — 10y
Ad