Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does this script keep breaking?

Asked by
Xl5Xl5 65
9 years ago

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!

repeat wait() until game.Players.LocalPlayer.Character:findFirstChild("Humanoid")~=nil
local Workspace = game:GetService("Workspace")
local Players = game:GetService("Players")
local Lighting = game:GetService("Lighting")
local RS = game:GetService("ReplicatedStorage")
local SSS = game:GetService("ServerScriptService")
local Teams = game:GetService("Teams")

local Player = Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local Mouse = Player:GetMouse()
local Camera = game.Workspace.CurrentCamera

local Gui = script.Parent
local Sounds = Gui:WaitForChild("Sounds")
local Holder = Gui:WaitForChild("Holder")

local GenderFrame = Holder:WaitForChild("Gender")
local GenderChooser = GenderFrame:WaitForChild("GenderChooser")
local NameFrame = GenderFrame:WaitForChild("Name") 

local CustomizationFrame = Holder:WaitForChild("Customization")
local SkinColorFrame = CustomizationFrame:WaitForChild("SkinColors")
local ClothingFrame = CustomizationFrame:WaitForChild("Clothing")
local HatFrame = CustomizationFrame:WaitForChild("Hat")
local AccessoryFrame = CustomizationFrame:WaitForChild("Accessory")
local Accessory2Frame = CustomizationFrame:WaitForChild("Accessory2")
local FaceFrame = CustomizationFrame:WaitForChild("Face")

local SkinColorNumber = 1
local ClothingNumber = 1
local HatNumber = 1
local AccessoryNumber = 1
local Accessory2Number = 1
local FaceNumber = 1
local SelectedName = ""
-----------------------------------
-- Customization tables
-----------------------------------
SelectedOutfit = {
    SkinColor = SkinColorNumber,
    Clothing = ClothingNumber,
    Hair = nil,
    Hat = HatNumber,
    Accessory = AccessoryNumber,
    Accessory = Accessory2Number,
    Face = FaceNumber,
    Name = "",
}

SkinColors = {
    "Pastel brown",
    "Nougat",
    "Dark orange",
    "Brown",
    "Reddish brown",
    "Br. yellowish orange",
    "Cool yellow",
    "White",
    "CGA brown",
    "Brick yellow",
    "Pastel yellow",
    "Medium blue"

}

local MensWardrobe = {

    Hats = {

            {
                Name = "Purple Hair",
                MeshId = "http://www.roblox.com/asset/?id=80233399",
                TextureId = "http://www.roblox.com/asset/?id=32492485",
                Offset = Vector3.new(0, 0, 0),
                Scale = Vector3.new(1.025, 1, 1.05),
                AttachmentPos = Vector3.new(0,0.5,-0.4),
            },
    },

    Accessories = {
        {
            Name = "None",
            MeshId = "",
            TextureId = "",
            Offset = Vector3.new(0, 0, 0),
            Scale = Vector3.new(0.55, 0.55, 0.55),
            AttachmentPos = Vector3.new(0, 0.699999988, 0.300000012),
    },
    },

    Accessories2 = {
        {
            Name = "None",
            MeshId = "",
            TextureId = "",
            Offset = Vector3.new(0, 0, 0),
            Scale = Vector3.new(0.55, 0.55, 0.55),
            AttachmentPos = Vector3.new(0, 0.699999988, 0.300000012),
        },  
    },

    Clothing = {
        {
            Name = "Kamui",
            PantsId = "http://www.roblox.com/asset/?id=100382380",
            ShirtId = "http://www.roblox.com/asset/?id=122209665",
            TShirtId = nil,
        },          
    },

Face = {
        {
                        Name = "No face",
            Texture = "",
    },
    },

}

local WowmensWardrobe = {

    Hats = {
        {
            Name = "clothe1",
            MeshId = "http://www.roblox.com/asset/?id=81644781",
            TextureId = "http://www.roblox.com/asset/?id=83317680",
            Offset = Vector3.new(0, 0, 0),
            Scale = Vector3.new(1, 1, 1),
            AttachmentPos = Vector3.new(0, 0, 0),
        },
    },

    Accessories = {
        {
            Name = "None",
            MeshId = "",
            TextureId = "",
            Offset = Vector3.new(0, 0, 0),
            Scale = Vector3.new(0.55, 0.55, 0.55),
            AttachmentPos = Vector3.new(0, 0.699999988, 0.300000012),
        }
    },
    Accessories2 = {
        {
            Name = "None",
            MeshId = "",
            TextureId = "",
            Offset = Vector3.new(0, 0, 0),
            Scale = Vector3.new(0.55, 0.55, 0.55),
            AttachmentPos = Vector3.new(0, 0.699999988, 0.300000012),

        }
    }, 
    Clothing = {
        {
            Name = "Zatsune Miku",
            PantsId = "http://www.roblox.com/asset/?id=113010540",
            ShirtId = "http://www.roblox.com/asset/?id=113010536",
            TShirtId = nil,
        },
    },

Face = {
        {
            Name = "Happy",
            Texture = "rbxassetid://169276937",
        },  
    },

}

local SelectedGender = nil
0
No output.. Nickoakz 231 — 9y

Answer this question