yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
|
| 07 May 2014 12:58 PM |
Here is my script, i want it so when an admin types map/(MAPNAME) it will change to that map. Here is my script admins = {"yobo89", "Player1"}
function isPlayerAdmin(name) for i,v in pairs(admins) do if name == v then return true end end return false end
function chatted(msg, recpt) if string.sub(msg, 1, 4) == "map/" then local map = game.ServerStorage.Maps:FindFirstChild(string.sub(msg, 5)) if map then CurrentMap = yobo89 end end end
function playerAdded(newPlayer) if isPlayerAdmin(newPlayer.Name) then newPlayer.Chatted:connect(chatted) else print("Player Is Not Admin") end end
game.Players.PlayerAdded:connect(playerAdded)
-----------------------------------------------------------
local Maps = {}
for _, Map in pairs (Game.ServerStorage.Maps:GetChildren()) do table.insert(Maps, Map:Clone()) end
Game.ServerStorage.Maps:Destroy()
local LastMap while wait() do local Map repeat Map=Maps[math.random(#Maps)] until Map~=LastMap LastMap=Map
m = Instance.new("Message",game.Workspace) for i,v in pairs(game.Players:GetChildren()) do Instance.new("ForceField", v.Character) end wait(10) CurrentMap = Map:Clone() m.Text = ("The following map was made by " .. CurrentMap.Name) wait(3) m:Destroy() CurrentMap.Parent = game.Workspace CurrentMap:MakeJoints() CurrentMap:MoveTo(Vector3.new(-172.5, 3, 121.5))
target = CFrame.new(-172.5, 17, 121.5) --could be near a brick or in a new area for i, player in ipairs(game.Players:GetChildren()) do player.Character.Torso.CFrame = target + Vector3.new(0, i * 5, 0) --add an offset of 5 for each character end
wait(300) -- 5 minutes target = CFrame.new(-143, 90, 118.5) --could be near a brick or in a new area for i, player in ipairs(game.Players:GetChildren()) do player.Character.Torso.CFrame = target + Vector3.new(0, i * 5, 0) --add an offset of 5 for each character end CurrentMap:Destroy()
end |
|
|
| Report Abuse |
|
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
|
| 07 May 2014 01:01 PM |
| Where it says "CurrentMap = yobo89" it should say CurrentMap = map |
|
|
| Report Abuse |
|
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
| |
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
| |
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 07 May 2014 02:49 PM |
local folder = game.ReplicatedStorage:WaitForChild("Maps") local admins = {azarth = true, player1 = true, yobo89 = true}
local function return_map(msg) for a,b in pairs(folder:GetChildren()) do local map = string.find(b.Name:lower(),msg) if map then return b end end end
game.Players.PlayerAdded:connect(function(plr) plr.Chatted:connect(function(msg) if admins[plr.Name:lower()] then local map = return_map(msg:lower()) if map then map:Clone().Parent = Workspace end end end) end)
|
|
|
| Report Abuse |
|