generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Character auto loads

Previous Thread :: Next Thread 
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
16 Apr 2013 07:19 PM
Im trying to make a script to do something when a play dies, but I need it to wait longer before respawning them.

If I make CharacterAutoLoads = false and use :LoadCharacter() to respawn them they can no enter the game at all, any ideas?
Report Abuse
MassiveGman is not online. MassiveGman
Joined: 23 Jan 2011
Total Posts: 2019
16 Apr 2013 07:22 PM
you could just move their character into lighting while the wait period is going on.
then use load character to get them back




|MassiveGman| Scripter & part time Professional Whistler
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
16 Apr 2013 07:22 PM
Add this maybe?:

game.Players.CharacterAutoLoads = false
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
char.Humanoid.Died:connect(function()
--ur coad hear
end)
end)
wait(1) -- change to amount of time before play spawns upon entering actual game
plr:LoadCharacter()
end)
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
16 Apr 2013 07:24 PM
@Cea
No, the problem is if I have auto load off, they are stuck on the "Waiting for character" thing

@Mas
I'll try it
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
16 Apr 2013 07:25 PM
LOL! You call the LoadCharacter method! What's not going to work?
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
16 Apr 2013 07:27 PM
"Whats not going to work"

Because if I try and load character while they are on that page

It says

"Blah blah server back end" in the output
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
16 Apr 2013 07:28 PM
Do it in Online mode..?
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
16 Apr 2013 07:29 PM
@Mas
It still loads their character like it would normally

repeat
wait(0.03)
until Game.Players.LocalPlayer.Character ~= nil

repeat
wait(0.03)
until Game.Players.LocalPlayer.Character.Humanoid.Health == 0
print("Death")
Game.Players.LocalPlayer.Character.Parent = Game.Players.LocalPlayer
wait(30)
Game.Players.LocalPlayer:LoadCharacter()
Report Abuse
MassiveGman is not online. MassiveGman
Joined: 23 Jan 2011
Total Posts: 2019
16 Apr 2013 07:30 PM
Personally, this is what I had done.

After experimenting with the lighting and everything, I found this the simplest.

-When the period of waiting is activated, a forcefield is inserted into the players that I wish to keep out of the game.

-Then, their walkspeed is lowered to 0

-When I wish to bring them back, I remove the forcefield, and give them their walkspeed back.


|MassiveGman| Scripter & part time Professional Whistler
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
16 Apr 2013 07:30 PM
Oh and I also tried it with parenting it to Game.Lighting
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
16 Apr 2013 07:31 PM
@Mas
But I want this to work when they die
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
16 Apr 2013 07:53 PM
Yeah, make CharacterAutoLoads false.


Here:


game.Players.PlayerAdded:connect(function(player)
repeat wait() until player.Character
player.Changed:connect(function(change)
if change == "Character" then

-- Do your stuff.
wait(12) -- Wait time before spawn.
player:LoadCharacter()
end
end)

end)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image