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

How can I alter this script to make it a GUI Map Loader?

Asked by
Stix92 0
8 years ago
activeMap = nil
local admins = {"Stix92"}


function isAdmin(p)
    for i,v in pairs(admins)do
        if v:lower() == p.Name:lower() then
            print("mhm")
            return true
        end
    end
    return false
end
game.Players.PlayerAdded:connect(function(player)
    if isAdmin(player) then
        player.Chatted:connect(function(msg)
            if msg:lower():sub(1,6) == ":load " then
                for i,v in pairs(game.Lighting:GetChildren())do
                    if v.Name:lower() == msg:lower():sub(7,msg:len()) then
                        activeMap = v:Clone()
                        activeMap.Parent = workspace

                        local h = Instance.new("Hint",workspace)
                        h.Text = activeMap.Name.." Loaded."
                        wait(2)
                        h:remove()
                    end
                end
            end
            if msg:lower() == ":end" then
                local h = Instance.new("Hint",workspace)
                h.Text = activeMap.Name.." Cleared."
                wait(2)
                h:remove()

                activeMap:remove()
                activeMap = nil
            end
        end)
    end
end)

0
What do you mean GUI map loader? RafDev 109 — 8y
0
Go here and see what I mean, the GUIs are what I want it to be like. Including the big blue one. http://www.roblox.com/games/261132021/Test Stix92 0 — 8y

Answer this question