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 » Scripters
Home Search
 

Re: Weird Player:LoadCharacter() loop glitch

Previous Thread :: Next Thread 
andr315j is not online. andr315j
Joined: 25 Mar 2012
Total Posts: 518
20 May 2017 02:56 PM
Why is this script loop spawning me?

script:


game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
wait()
if game.ReplicatedStorage.Settings.DeathSet.Value == false then
Player:LoadCharacter()
Player.Team = game.Teams.Death
game.ReplicatedStorage.Settings.DeathSet.Value = true
--Player:LoadCharacter()
elseif game.ReplicatedStorage.Settings.DeathSet.Value == true then
if game.ReplicatedStorage.Settings.CanJoin.Value == true then
Player:LoadCharacter()
Player.Team = game.Teams.Runners
--Player:LoadCharacter()
elseif game.ReplicatedStorage.Settings.CanJoin.Value == false then
Player:LoadCharacter()
Player.Team = game.Teams.Spectators
--Player:LoadCharacter()
else
Player:LoadCharacter()
end
end
end)
end)
Report Abuse
andr315j is not online. andr315j
Joined: 25 Mar 2012
Total Posts: 518
20 May 2017 03:15 PM
Anyone got an answer to this?
Report Abuse
ahwz is not online. ahwz
Joined: 01 Apr 2010
Total Posts: 3230
20 May 2017 03:17 PM
You have LoadCharacter inside of a CharacterAdded

So everytime you spawn it runs that code in turn will keep calling the loadcharacter method.






Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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