I went into my game after testing this script and having it work:
local function onPlayerEntered(newPlayer) newPlayer.CameraMaxZoomDistance = 8 newPlayer.Character.Torso.CFrame = game.Workspace.Tele2.CFrame local lol = script.MenuGui:Clone() local lol2 = script.StartGui:Clone() lol.Sound.Playing = true lol.Parent = newPlayer.PlayerGui lol2.Frame.Script.Disabled = false lol2.Frame.TextLabel2.Script.Disabled = false lol2.Parent = newPlayer.PlayerGui end game.Players.PlayerAdded:connect(onPlayerEntered)
This script causes the start menu and start animation GUI to open. It turns on the menu music and animation scripts. It also changes how far out a player can scroll.
After adding a new section to my game's main script, this script broke 100%. Not one thing in the script worked, while the main script worked. The addition to the main script was the following:
math.randomseed(os.time()); local list = {}; function foo() for index, child in pairs(game.ReplicatedStorage.Maps:GetChildren()) do wait(); list[index] = child; end randomMap = list[math.random(1,table.getn(list))]:Clone(); randomMap.Parent = game.Workspace.MapHolder; end foo(); locations = randomMap.Spawns for _,v in pairs(game.Players:GetChildren()) do local spawnlocation = locations:FindFirstChild('Part') v.Character.Torso.CFrame = spawnlocation.CFrame spawnlocation.Parent = spawnlocation.Parent.Parent end
Feel free to comment a question. I need all the help I can get.