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: This is probably obvious but I'm stuck and could use help.

Previous Thread :: Next Thread 
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
03 Jun 2015 03:00 PM
This is supposed to change my players into characters at the beginning of each round but it doesn't, it freezes the game or severely lags it. Nothing in output.

local char = game.ServerStorage:WaitForChild("Characters")
print("Found")
local Chars = char:GetChildren()
local reRun = false;
function Morph()
wait (10)
print ("Started")
for i, player in ipairs(game.Players:GetChildren()) do
local New = Chars[math.random(1, #Chars)]
local Taken = New:WaitForChild("IsTaken")
if Taken == true then
print("This char is taken!")
reRun = true;
elseif Taken == false then
reRun =false;
Taken.Value = true
New.Parent = game.Workspace
New:MakeJoints()
local CharCam = script.Camera:Clone()
CharCam.Parent = player.PlayerGui
local CharName = script.Value:Clone()
CharName.Value = New.Name
CharName.Parent = CharCam
player:LoadCharacter()
wait (1)
player.Character:Destroy()
player.Character = New
end
end

repeat Morph() until not reRun;
Morph()
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
03 Jun 2015 03:40 PM
Bump.
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
03 Jun 2015 03:55 PM
Serarch CustomChar[2] in models, i made it on my old account. Then you wont need to change it every round.
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
03 Jun 2015 04:01 PM
...I don't want a free model, I want to make it myself, and also, I want to change it each round.
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
03 Jun 2015 04:02 PM
Put a print() statement after each line and see where it stops.

Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
03 Jun 2015 04:02 PM
I made it and its not a damm free model. I said you can have it so take it or leave, buddy.
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
03 Jun 2015 04:07 PM
Thanks for your offer, but I'd like to make this myself so I can get more knowledge. Thanks though.
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
03 Jun 2015 04:09 PM
I agree with Klink. He should try to be more independent. In life, you can't always get your answers handed to you.

Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
03 Jun 2015 04:10 PM
The line that starts the function is where it breaks...
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
03 Jun 2015 04:25 PM
Help :(
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
03 Jun 2015 04:27 PM
Which one?

Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784

Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
03 Jun 2015 04:29 PM
function Morph()
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
03 Jun 2015 04:32 PM
I don't see anything. But, what's this for?

repeat Morph() until not reRun;
Morph()

You're calling Morph() until reRun is false then you're calling it again?!

Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
03 Jun 2015 04:36 PM
I'm not sure, somebody told me to use it but I didn't really know how to use it... How can I fix it?
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
03 Jun 2015 04:50 PM
:(
Report Abuse
notfruit is not online. notfruit
Joined: 21 Sep 2012
Total Posts: 1386
03 Jun 2015 04:55 PM
"I don't want anybody to do things for me"

"halp pls fix my script"

lol
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
03 Jun 2015 04:56 PM
@notfruit

I am you. Obey me.

Also, have no idea why I wanted to pick on you.
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
03 Jun 2015 04:57 PM
Ok lol that's funny. But I still need help.
Report Abuse
ohno1112 is not online. ohno1112
Joined: 23 Mar 2013
Total Posts: 833
03 Jun 2015 05:10 PM
you are not calling the morph function at all, except at

repeat Morph() until not rerun.
Report Abuse
ohno1112 is not online. ohno1112
Joined: 23 Mar 2013
Total Posts: 833
03 Jun 2015 05:12 PM
but, that block of code ends when rerun is false, and rerun is false at the start so it doesn't run.

and unlike while, a repeat until will not be restarted when rerun becomes true.

lastly, your manual morph() at the bottom, exzecutes at server start, before any players join.

above reasons are probably why you get no prints inside your function. make sure to call it exactly when you want it.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Jun 2015 05:13 PM
ohno, it does run, and if reRun is set to true INSIDE, it will run again
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