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

Help on Custom Map Changer? [Script Inside]

Asked by
Moxeh 84
10 years ago

The goal is for it to teleport every player in the server within the defined borders every (300) then delete the old map, clone the new map, and then respawn the players. Please post a fixed version if you can do so. Thanks!

Here is the script:

local MaxTele = Vector2.new(106, -371)
local MinTele = Vector2.new(66, -332)
local TeleHeight = 70.814

local function TeleportPlayer(Player)
    if Player and Player.Character and Player.Character:FindFirstChild("Torso") then
        local Position = Vector3.new(math.random(MinTele.X,MaxTele.X),TeleHeight,math.random(MinTele.Y,MaxTele.Y))
        Player.Character:MoveTo(Position)
    end
end


while true do
    wait(10)--Map time (300)
    local modelGroup = game.ReplicatedStorage:FindFirstChild("Maps"):GetChildren()
    local PickedModel = modelGroup[math.random(1, #modelGroup)]
    local Model = PickedModel:Clone()
    if game.Workspace:FindFirstChild("Map") then

    game.Workspace.Map:Destroy()
    end
    --Teleport players to area (LOCAL DEFINITIONS)

    for i,v in pairs(game.Players:GetPlayers()) do
        TeleportPlayer(v)
    end

    wait(5)
    for i, v in pairs(game.Players:GetChildren()) do
    v:LoadCharacter() end

    wait(1)

    Model.Parent = game.Workspace


    end

1 answer

Log in to vote
0
Answered by 10 years ago

The answer: If there is a problem, always DC it. If you don't DC it, It can be difficult.

0
DC? Moxeh 84 — 10y
0
Double Check. ValkyrieXNominator 0 — 10y
Ad

Answer this question