Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 30 May 2015 10:18 PM |
I have finally gotten this script to work in a server but for some reason it respawns the players like a second after they morph, and there's nothing in the output. I apologize if this question has an obvious answer and if the script looks inefficient, I'm really tired.
local char = game.ServerStorage:WaitForChild("Characters") print("Found") local Chars = char:GetChildren() function Morph() wait (10) print ("Started") for i, player in ipairs(game.Players:GetChildren()) do if player.Character and player.Character:FindFirstChild("Torso") then local New = Chars[math.random(1, #Chars)] local Taken = New:WaitForChild("IsTaken") if Taken.Value == false then 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.Character:Destroy() player.Character = New elseif Taken.Value == true then print("This char is taken!") Morph() end end end end Morph()
|
|
|
| Report Abuse |
|
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 30 May 2015 10:40 PM |
| Help please, at least show me a line that's a possible culprit. |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 30 May 2015 10:41 PM |
Players.CharacterAutoLoads
Set it to false.
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 30 May 2015 10:43 PM |
| Ooh, if you don't mind me asking, what does that do? |
|
|
| Report Abuse |
|
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 30 May 2015 10:48 PM |
| Ok I added that and now my player isn't spawning at all. |
|
|
| Report Abuse |
|
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 30 May 2015 10:53 PM |
Here:
game.Players.CharacterAutoLoads = false local char = game.ServerStorage:WaitForChild("Characters") print("Found") local Chars = char:GetChildren() function Morph() wait (20) print ("Started") for i, player in ipairs(game.Players:GetChildren()) do if player.Character and player.Character:FindFirstChild("Torso") then local New = Chars[math.random(1, #Chars)] local Taken = New:WaitForChild("IsTaken") if Taken.Value == false then 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.Character:Destroy() player.Character = New player:LoadCharacter() elseif Taken.Value == true then print("This char is taken!") Morph() end end end end Morph()
|
|
|
| Report Abuse |
|
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
| |
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 30 May 2015 11:36 PM |
plr:LoadCharacter()
use it somewhere |
|
|
| Report Abuse |
|
|