|
| 31 Aug 2012 01:45 PM |
I have a script where when the player chats "run/" and then the map name, the script will copy the map from lighting to workspace. If they chat again, the old map will be replaced by the other map.
I have designed an entire GUI, but not I lack this script to work with the GUI. All I want is some script similar to this script which will go inside the "RUN" button. When someone clicks the "RUN" button, it will do what this script does when someone chats "run/":
current_map = nil
names = {"ROBLOXHAMTAH", "ash18"}
game.Players.PlayerAdded:connect(function(player) for i, v in pairs(names) do if v == player.Name then player.Chatted:connect(function(chatmsg) if chatmsg:sub(1,4) == "run/" then local map = chatmsg:sub(5, chatmsg:len()) if game.Lighting:FindFirstChild(map) then if current_map ~= nil then current_map.Parent = game.Lighting end game.Lighting[map].Parent = game.Workspace current_map = game.Workspace[map] end end end) end end end)
|
|
|
| Report Abuse |
|
|
|
| 31 Aug 2012 01:46 PM |
| I don't really care if you remove the admin function, as the entire GUI can only be seen by admins to start with. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
L2000
|
  |
| Joined: 03 Apr 2008 |
| Total Posts: 77448 |
|
|
| 31 Aug 2012 09:10 PM |
current_map = nil gui = script.Parent -- The run button textFind = gui.Parent.Map -- Where to find the map name; the GUI
gui.MouseButton1Down:connect(function() local map = gui.Text if game.Lighting:FindFirstChild(map) then if current_map ~= nil then current_map.Parent = game.Lighting end game.Lighting[map].Parent = game.Workspace current_map = game.Workspace[map] end end)
|
|
|
| Report Abuse |
|
|
L2000
|
  |
| Joined: 03 Apr 2008 |
| Total Posts: 77448 |
|
|
| 31 Aug 2012 09:10 PM |
Err, replace: local map = gui.Text
With local map = textFind.Text
Otherwise, it will look for "Run" |
|
|
| Report Abuse |
|
|
|
| 31 Aug 2012 09:28 PM |
@L2000
Didn't work at all. Here is the script:
current_map = nil gui = script.Parent -- The run button textFind = gui.Parent.FFA1 -- Where to find the map name; the GUI
gui.MouseButton1Down:connect(function() local map = textFind.Text if game.Lighting:FindFirstChild(map) then if current_map ~= nil then current_map.Parent = game.Lighting end game.Lighting[map].Parent = game.Workspace current_map = game.Workspace[map] end end)
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|