How can I alter this script to make it a GUI Map Loader?
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)