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 » Scripting Helpers
Home Search
 

Re: Friend wont teleport out but I can

Previous Thread :: Next Thread 
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
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
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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