|
| 23 Jul 2014 10:05 PM |
Ok, lets get this organised to it's easy to ready and understand. Function 1 of script 1 checks to see if the player has stored data. Function 2 saves the data every time the player dies, just so he can respawn back the same person. I figured that it's the second script since he has literally NO armor and doesn't teleport out, which both happens in there;
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) wait(5) for i, CM in pairs (character:GetChildren()) do if CM:IsA("CharacterMesh") or CM:IsA("Hat") or CM:IsA("BodyColor") then CM:Remove()
------------It seems that either from here or at the start it breaks. Thought I don't know why, rookie mistake? I doubt it since it works perfectly for me. if game.ServerStorage.Storage[player.Name]:findFirstChild("Armour")~=nil then for i,a in pairs (game.ServerStorage.Storage[player.Name].Armour:GetChildren()) do a:Clone().Parent=character character.Torso.CFrame=CFrame.new(-292, 43, 155) end
else ------------So if the player is new, he will go through a cinematic intro, which is NewPlayerScript blow. player.PlayerGui.NewPlayerScript.Disabled=false wait(3) s=Instance.new("Model") s.Name="Armour" s.Parent=game.ServerStorage.Storage[player.Name] w=Instance.new("Model") w.Name="Weapons" w.Parent=game.ServerStorage.Storage[player.Name] bc=Instance.new("BodyColors") bc.Name="Body Colors" bc.Parent=s for i,a in pairs (game.ServerStorage.Storage.Default.Armour:GetChildren()) do a:Clone().Parent=character a:Clone().Parent=game.ServerStorage.Storage[player.Name].Armour end end end end
-------------Below is not needed if player.PlayerGui.Data.InBattle.Value==true then for i,w in pairs (game.ServerStorage.Storage[player.Name].Weapons:GetChildren()) do w:Clone().Parent=player.Backpack end end end) end) |
|
|
| Report Abuse |
|
|
| 23 Jul 2014 10:06 PM |
| I'm so stupid. Read only "I figured that it's the second script since he has literally NO armor and doesn't teleport out, which both happens in there;" |
|
|
| Report Abuse |
|