Harple
|
  |
| Joined: 08 Oct 2012 |
| Total Posts: 2006 |
|
|
| 08 Jul 2015 08:24 AM |
So, I know how to do the basic,
part = script.Parent
part.Touched:connect(funtion() Map = game.Lighting.Map:Clone() Map.Parent = game.Workspace end)
But, I wanna learn how to have maps load with a command, rather than stepping on a brick. |
|
|
| Report Abuse |
|
|
Alyte
|
  |
| Joined: 24 Oct 2011 |
| Total Posts: 10090 |
|
| |
|
|
| 08 Jul 2015 09:06 AM |
function load(MapName) game:GetService("ReplicatedStorage"):FindFirstChild(MapName).Parent = game.Workspace end
function end(MapName) game.Workspace:FindFirstChild(MapName).Parent = game:GetService("ReplicatedStorage") end
load("Map") end("Map")
Wallah, two functions to load and unload. I suggest you make your own event. |
|
|
| Report Abuse |
|
|
Alyte
|
  |
| Joined: 24 Oct 2011 |
| Total Posts: 10090 |
|
|
| 08 Jul 2015 09:14 AM |
| UU cant cal A Function End() Kid. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2015 09:19 AM |
Shhh i'm messing with his head.....
If he's smart he'll know how to code and not be just asking for a script..... I want him to have it broken muahhaha. |
|
|
| Report Abuse |
|
|
Harple
|
  |
| Joined: 08 Oct 2012 |
| Total Posts: 2006 |
|
|
| 08 Jul 2015 09:32 AM |
oi vie....
dango. dango. lionbaita's otaku maid |
|
|
| Report Abuse |
|
|
AkxKaxXa
|
  |
| Joined: 12 Sep 2013 |
| Total Posts: 72 |
|
|
| 08 Jul 2015 09:33 AM |
it seems simple so i came up with this (store maps in ServerStorage):
local t = { connections = {}, admins = {33052995, -1}, -- I tested in studio }
function checkIfInTable(player) for i, userId in pairs(t.admins) do if userId == player.userId then return true end end end
function onChatted(msg, speaker) if msg:sub(1, 6):lower() == '/load ' then local mapName = msg:sub(7) if mapName == "" then return end local map = game.ServerStorage:FindFirstChild(mapName) if not map then return end local clone = map:Clone() clone.Parent = game.Workspace clone:MakeJoints() elseif msg:sub(1, 7):lower() == '/clear ' then local mapName = msg:sub(8) if mapName == "" then return end if workspace:FindFirstChild(mapName) then workspace[mapName]:Destroy() end end end
game.Players.PlayerAdded:connect(function(player) if checkIfInTable(player) then t.connections[player.userId] = player.Chatted:connect(function(msg) print(msg) onChatted(msg, player) end) end end)
game.Players.PlayerRemoving:connect(function(player) if t.connections[player.userId] then t.connections[player.userId]:disconnect() end end) |
|
|
| Report Abuse |
|
|