OpisekJoin Date: 2014-08-05 Post Count: 155 |
Hello!
I tried to make my character load after the menu closes.
What I tried to do is uncheck the AutoLoadCharacter and put player:LoadCharacter() on the end of the menu script. Now when I started game the menu didn't show. The scipt of the menu i1s in the StarterGui -> ScreenGui -> Frame and it's a local script. Please help me. Thanks! |
|
OpisekJoin Date: 2014-08-05 Post Count: 155 |
Please help me |
|
|
if memory serves me well, you have to call ::LoadCharacter() at least once, since the starter objects won't replicate anything to the player until ::LoadCharacter() is called.
in a server script, you could accomplish this by doing...
players.PlayerAdded:connect(function(p)
p.CharacterAdded:wait()
p.Character:Destroy()
end)
... or similar.
PS: typed on mobile forgive any mistakes |
|
OpisekJoin Date: 2014-08-05 Post Count: 155 |
So I should place it on the beginning of the menu script right? I have to put the LoadCharacter on the end then and uncheck the AutoLoadCharacter? |
|
|
no you dunce try actually reading my reply rather than taking the code and running |
|
OpisekJoin Date: 2014-08-05 Post Count: 155 |
I'm not English, so I don't understand very well and I didn't try this code, I just asked where should it be in. |
|
OpisekJoin Date: 2014-08-05 Post Count: 155 |
And it doesn't work when I place it in server scirpt (character auto loads is on) I just can walk around when I'm in menu. |
|
OpisekJoin Date: 2014-08-05 Post Count: 155 |
It says that the global var players has a nil value |
|
zaniac10Join Date: 2009-08-18 Post Count: 10000 |
"no you dunce try actually reading my reply rather than taking the code and running"
why are you so rude you snobby, annoying obc'er??/?!??
as for the original reply, when you say "I tried to make my character load after the menu closes," how do you want it to close? exit button? |
|
|
"why are you so rude you snobby, annoying obc'er??/?!??"
- i've been called a lot of things... but "annoying obc'er" is definitely a first.
- because he doesn't know jack about scripting and came here to take the code and run. that's what the majority of this trash community does.
i mean come on what kind of moron doesn't at least understand that "players" is pseudo-code for game.Players lmaooo
|
|
zaniac10Join Date: 2009-08-18 Post Count: 10000 |
you're the only trash of this community as you're so unnecessarily rude and you are only infesting others' vulnerable, young minds on this forum with your bs |
|
|
ok hun sorry for being honest about this kid being utter trash at scripting xD
|
|
TimeTicksJoin Date: 2011-04-27 Post Count: 27115 |
--server script
local re = game.ReplicatedStorage:WaitForChild("RemoteEvent")
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
char:Destroy()
end)
end)
re.OnServerEvent:connect(function(plr)
plr:LoadCharacter()
end)
--local script
local re = game.ReplicatedStorage:WaitForChild("RemoteEvent")
menu.MouseButton1Click:connect(function()
re:FireServer()
end) |
|