Why does this script keep breaking?
This is just top part of the script which is a Local Script which is part of a ScreenGUI inside StarterGUI
StarterGUI
-->ScreenGUI
---->Local Script
The problem here is that, when the player respawns the Local Script breaks.
this script works in solo mode fine. However on online mode works when you first enter the game it works fine, but when you respawn the Local Script doesn't seem to work
Please help! thank you!
001 | repeat wait() until game.Players.LocalPlayer.Character:findFirstChild( "Humanoid" )~ = nil |
002 | local Workspace = game:GetService( "Workspace" ) |
003 | local Players = game:GetService( "Players" ) |
004 | local Lighting = game:GetService( "Lighting" ) |
005 | local RS = game:GetService( "ReplicatedStorage" ) |
006 | local SSS = game:GetService( "ServerScriptService" ) |
007 | local Teams = game:GetService( "Teams" ) |
009 | local Player = Players.LocalPlayer |
010 | local Character = Player.Character |
011 | local Humanoid = Character:WaitForChild( "Humanoid" ) |
012 | local Mouse = Player:GetMouse() |
013 | local Camera = game.Workspace.CurrentCamera |
015 | local Gui = script.Parent |
016 | local Sounds = Gui:WaitForChild( "Sounds" ) |
017 | local Holder = Gui:WaitForChild( "Holder" ) |
019 | local GenderFrame = Holder:WaitForChild( "Gender" ) |
020 | local GenderChooser = GenderFrame:WaitForChild( "GenderChooser" ) |
021 | local NameFrame = GenderFrame:WaitForChild( "Name" ) |
023 | local CustomizationFrame = Holder:WaitForChild( "Customization" ) |
024 | local SkinColorFrame = CustomizationFrame:WaitForChild( "SkinColors" ) |
025 | local ClothingFrame = CustomizationFrame:WaitForChild( "Clothing" ) |
026 | local HatFrame = CustomizationFrame:WaitForChild( "Hat" ) |
027 | local AccessoryFrame = CustomizationFrame:WaitForChild( "Accessory" ) |
028 | local Accessory 2 Frame = CustomizationFrame:WaitForChild( "Accessory2" ) |
029 | local FaceFrame = CustomizationFrame:WaitForChild( "Face" ) |
031 | local SkinColorNumber = 1 |
032 | local ClothingNumber = 1 |
034 | local AccessoryNumber = 1 |
035 | local Accessory 2 Number = 1 |
037 | local SelectedName = "" |
042 | SkinColor = SkinColorNumber, |
043 | Clothing = ClothingNumber, |
046 | Accessory = AccessoryNumber, |
047 | Accessory = Accessory 2 Number, |
058 | "Br. yellowish orange" , |
068 | local MensWardrobe = { |
073 | Name = "Purple Hair" , |
076 | Offset = Vector 3. new( 0 , 0 , 0 ), |
077 | Scale = Vector 3. new( 1.025 , 1 , 1.05 ), |
078 | AttachmentPos = Vector 3. new( 0 , 0.5 ,- 0.4 ), |
087 | Offset = Vector 3. new( 0 , 0 , 0 ), |
088 | Scale = Vector 3. new( 0.55 , 0.55 , 0.55 ), |
089 | AttachmentPos = Vector 3. new( 0 , 0.699999988 , 0.300000012 ), |
098 | Offset = Vector 3. new( 0 , 0 , 0 ), |
099 | Scale = Vector 3. new( 0.55 , 0.55 , 0.55 ), |
100 | AttachmentPos = Vector 3. new( 0 , 0.699999988 , 0.300000012 ), |
122 | local WowmensWardrobe = { |
129 | Offset = Vector 3. new( 0 , 0 , 0 ), |
130 | Scale = Vector 3. new( 1 , 1 , 1 ), |
131 | AttachmentPos = Vector 3. new( 0 , 0 , 0 ), |
140 | Offset = Vector 3. new( 0 , 0 , 0 ), |
141 | Scale = Vector 3. new( 0.55 , 0.55 , 0.55 ), |
142 | AttachmentPos = Vector 3. new( 0 , 0.699999988 , 0.300000012 ), |
150 | Offset = Vector 3. new( 0 , 0 , 0 ), |
151 | Scale = Vector 3. new( 0.55 , 0.55 , 0.55 ), |
152 | AttachmentPos = Vector 3. new( 0 , 0.699999988 , 0.300000012 ), |
158 | Name = "Zatsune Miku" , |
174 | local SelectedGender = nil |