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
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
| |
|
|
| 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
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
| |
|
|
| 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
|
  |
| 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
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|