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

How would I delay someone from spawning until they press a button?

Asked by 8 years ago

Now I know this isn't a "Good Question" as defined by the help, but the only code I can provide for this one is ...

local newGame = script.Parent.NewGame
local loadGame = script.Parent.LoadGame
local changeLog = script.Parent.ChangeLog
local starterGui = game.StarterGui

newGame.MouseButton1Down:connect(function()

end)

loadGame.MouseButton1Down:connect(function()

end)

changeLog.MouseButton1Down:connect(function()

end)

What I'm looking for is to not spawn the character until they press either newGame or loadGame, then to spawn the character and do the stuff I plan on doing later. Thanks in advance.

1 answer

Log in to vote
-1
Answered by 8 years ago

Ok, to stop a player from spawning:

game.Players.CharacterAutoLoads = false -- player can't spawn

Then, to spawn a player, do this:

game.Players.PlayerAdded:connect(function(p)
    local gui = script.GuiName:Clone()
    gui.Parent = p.PlayerGui -- DONE!
    local button -- this is what gets clicked
    button.MouseButton1Click:connect(function()
        p:LoadCharacter()
    end
end)
0
That doesn't seem to work jakei181 60 — 8y
0
What's the error? TheDeadlyPanther 2460 — 8y
0
The character still spawns. I moved the script from inside the GUI to the workspace and changed the variables, and that still doesn't work. Also, I made a function called loadButtons() which uses tweens, and that doesn't work either jakei181 60 — 8y
0
The character shouldn't spawn. Remove the CharacterAutoLoads part, and in studio, just manually change the property. TheDeadlyPanther 2460 — 8y
View all comments (9 more)
0
Now he doesn't spawn, but the GUI doesn't show up either :S jakei181 60 — 8y
0
PS, not sure if this matters, but FilteringEnabled is true jakei181 60 — 8y
0
Hmm.. This is weird. I'm gonna test it. TheDeadlyPanther 2460 — 8y
0
Well, you could just spawn the character in some black box... TheDeadlyPanther 2460 — 8y
0
I've got a good idea! We could manually clone the gui into the PlayerGui with the script we're using! Let me edit... TheDeadlyPanther 2460 — 8y
0
Nevermind, just do the black box thing, I don't think there is a way to fix it :c Here are some fixes I made, though. https://www.mediafire.com/?uu7gfbrt5zv7nw0 TheDeadlyPanther 2460 — 8y
0
I think it might be easier to add me on skype, it still doesn't work, the GUI doesn't work. :P A prime example of what i'm trying to accomplish is the One Piece Golden Age game. And my Skype is "zestyTG" (without "") jakei181 60 — 8y
0
Ook. I will add you in a sec. I'm EmeraldSlash TheDeadlyPanther 2460 — 8y
Ad

Answer this question