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

How Would I Add "local maps" function into my holo commands?

Asked by
IcyEvil 260 Moderation Voter
8 years ago

I have holo commands, and I need to know how to add a local map function, so that I can just have users go and put > local map = {MapName, MapName, MapName;ServerStorage

And then not have to go throughout the script posting the map name a million times to load, and then a million more to Destroy.

Here is the script(I also added an example on how I would want the format to be in) I am not asking for someone to do it for me, Im just asking how you would do that?

Script here.

local admins ={"YOURNAMEHERE","AdminNameHere","AdminName"} -- What Users(Needs to be EXACT)
local gid = 0 -- What group is needed
local gidranks = {0,0,0,0,0,0} -- What Ranks you want to be used
local maps = {MapName, MapName, MapName;ServerStorage}
--Dont Mess with the Below --
--
function contains(list, element)
    for _, value in pairs(list) do
        if value == element then
            return true
        end
    end
end
-- You can mess with below this, But only what I tell you, you can.

-- Spawning Function
game.Players.PlayerAdded:connect(function(Player)
    if contains(gidranks, Player:GetRankInGroup(gid)) then
        for _,v in pairs(admins)do
            Player.Chatted:connect(function(msg)
                if msg == "load sft" then -- What you want to have to say when you load this map
                x = game.ServerStorage.sft:Clone()-- Change sft to the map in serverstorage
                if game.ServerStorage.sft.Name == "sft" then -- what the map name is in serverstorage, MUST BE EXACT
                    local h = Instance.new("Hint")
                    h.Parent = game.Workspace
                    h.Text = "Loading Facility:// SwordFight" -- Change SwordFight to what the Map Name is(Just for coolio effect)
                    wait(2)
                    h:Destroy()
                    x.Parent = game.Workspace
                end
                end
            end)
        end
    end
end)
0
Bump IcyEvil 260 — 8y

Answer this question