|
hi all
me probelm is when i chose a map the map loads
but idk how i disipere the lobby
can sombady plz help
here is the scrip:
wait()
function loadmap()
for i, player in ipairs(game.Players:GetChildren()) do
player.PlayerGui.MAPCHOOSER.Chooser.Visible = true
end
wait(8)
if script.MAP1.Value > script.MAP3.Value and script.MAP1.Value > script.MAP2.Value then
-- map1
game.Lighting.map1.Parent = workspace
end
if script.MAP2.Value > script.MAP3.Value and script.MAP2.Value > script.MAP1.Value then
game.Lighting.map2.Parent = workspace
end
if script.MAP3.Value > script.MAP2.Value and script.MAP3.Value > script.MAP1.Value then
game.Lighting.map3.Parent = workspace
end
for i, player in ipairs(game.Players:GetChildren()) do
player.PlayerGui.MAPCHOOSER.Chooser.Visible = false
end
end
wait(30)
loadmap()
thanks for reading and hope you can help
(the group me lobby is in cals lobby ;) |
|
|
|
local mapamount=3
local currentmap
function tpplayers()
local spawnpointname="BRICK TO BE TELEPORTED TO NAME HERE."
if workspace:findFirstChild(currentmap) then
local map=workspace:findFirstChild(currentmap)
local spawn=map[spawnpointname]
for i,v in pairs(game.Players:GetChildren()) do
if v.Character then
v.Character:MoveTo(spawn.Position)
end
end
end
end
function loadrandommap()
local lighting=game.Lighting
local chosenmap=lighting["map"..math.random(1,mapamount)]:clone()
chosenmap.Parent=workspace
tpplayers()
end
wait(30)
loadrandommap()
|
|
|
so like that i will get a random map ? |
|
|
|
it works but how i disable lobby when map loads
and put it back after 5 minuts ? |
|
|
(and disable the maps after the 5 min) |
|
|
just move the lobby far away from the maps... |
|
|
k but then i whont teleport to the maps ? |
|
|
local mapamount=3
local currentmap
local intermissiontime=15
local gametime=5 --minutes
function tpplayers()
local spawnpointname="BRICK TO BE TELEPORTED TO NAME HERE."
if workspace:findFirstChild(currentmap) then
local map=workspace:findFirstChild(currentmap)
local spawn=map[spawnpointname]
for i,v in pairs(game.Players:GetChildren()) do
if v.Character then
v.Character:MoveTo(spawn.Position)
end
end
end
end
function loadrandommap()
local lighting=game.Lighting
local chosenmap=lighting["map"..math.random(1,mapamount)]:clone()
chosenmap.Parent=workspace
tpplayers()
end
function destroymap()
workspace[currentmap]:Destroy()
for i,v in pairs(game.Players:GetChildren()) do
if v.Character then
v.Character:BreakJoints()
end
end
end
local GameLoop=coroutine.wrap(function()
while wait() do
wait(intermissiontime)
loadrandommap()
wait(gametime*60)
destroymap()
end
end)
GameLoop() |
|
|
maybe it is better if i add u to team create bucauce i think i make it a mess XD
plz accept friend |
|
|
no ive literally gave you the entire script
put this in a normal script in serverscriptservice and move your lobby. the player gets teleported so it doesnt matter where its moved to |
|
|
|
it don't works for me
in "BRICK TO BE TELEPORTED TO NAME HERE."
i need to add the spawn name of lobby right ? |
|
|
|
i am now like 4 min 30 sec in game and it dont teleports me
i keep standing in the lobby
thanks for u help
but plz will you take a look wwith me what i ahev done wrong ? |
|
|
press F-9 and tell me anything thats red in serverlog |
|
|
|
in red
ServerScriptService.Script:42: ' = ' expected near ''
it is a litle bit edit with space beacauce roblox dont whant me to post it |
|
|
the script has only 41 lines, so there cant be an error on line 42
local mapamount=3
local currentmap
local intermissiontime=15
local gametime=5 --minutes
function tpplayers()
local spawnpointname="BRICK TO BE TELEPORTED TO NAME HERE."
if workspace:findFirstChild(currentmap) then
local map=workspace:findFirstChild(currentmap)
local spawn=map[spawnpointname]
for i,v in pairs(game.Players:GetChildren()) do
if v.Character~=nil then
v.Character:MoveTo(spawn.Position)
end
end
end
end
function loadrandommap()
local lighting=game.Lighting
local chosenmap=lighting["map"..math.random(1,mapamount)]:clone()
chosenmap.Parent=workspace
tpplayers()
end
function destroymap()
workspace[currentmap]:Destroy()
for i,v in pairs(game.Players:GetChildren()) do
if v.Character then
v.Character:BreakJoints()
end
end
end
local GameLoop=coroutine.wrap(function()
while wait() do
wait(intermissiontime)
loadrandommap()
wait(gametime*60)
destroymap()
end
end)
|
|
|
|
maybe is there a other way ? |
|