generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Turn this script to work with GUI...

Previous Thread :: Next Thread 
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
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
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
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
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
31 Aug 2012 02:17 PM
Help me out please...
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
31 Aug 2012 03:34 PM
Bump. >.>
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
31 Aug 2012 04:09 PM
No one?
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
31 Aug 2012 09:05 PM
Come on...
Report Abuse
L2000 is not online. 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 is not online. 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
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
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
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
31 Aug 2012 09:42 PM
Helps...
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
01 Sep 2012 10:28 AM
Nump
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
01 Sep 2012 06:30 PM
Help.sf
Report Abuse
ROBLOXHAMTAH is not online. ROBLOXHAMTAH
Joined: 08 Jul 2008
Total Posts: 9609
02 Sep 2012 09:28 AM
bumpo
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image