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: Help! Need scripting advice!

Previous Thread :: Next Thread 
Mixer103 is not online. Mixer103
Joined: 10 Mar 2011
Total Posts: 114
15 Aug 2013 01:37 PM
script.Parent.Touched:connect(function(hit)

Using that script, how can I load a map or something from lighting?
Report Abuse
Mixer103 is not online. Mixer103
Joined: 10 Mar 2011
Total Posts: 114
15 Aug 2013 01:39 PM
Like as soon as that brick is touched, by to user, not by clicking it, a map will load from lighting?
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
15 Aug 2013 01:48 PM
"load"
*copy


That's pretty much all you'd do. Just copy the thing from lighting.
Report Abuse
Mixer103 is not online. Mixer103
Joined: 10 Mar 2011
Total Posts: 114
15 Aug 2013 01:51 PM
So the script would be: (Sorry I'm still farily new to scripting)

script.Parent.Touched:connect(function(hit) load
workspace.lighting.map1

Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
15 Aug 2013 01:55 PM
local map = game.Lighting.map1:clone()
map.Parent = game.Workspace

Now to get rid of it, you can simply delete map with

map:Destroy()
Report Abuse
Mixer103 is not online. Mixer103
Joined: 10 Mar 2011
Total Posts: 114
15 Aug 2013 01:57 PM
script.Parent.Touched:connect(function(hit) load
local map = game.Lighting.map1:clone()
map.Parent = game.Workspace

So is that it? Or is there still some erors
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
15 Aug 2013 02:01 PM
d = true

script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not game.Workspace:FindFirstChild("map1") and d then
d = false
--let's make sure that player touched button, and that map isn't placed already. Also I used d, to prevent script from making too many maps
local map = game.Lighting.map1:clone()
map.Parent = game.Workspace
wait()
d = true
end
end)
Report Abuse
Mixer103 is not online. Mixer103
Joined: 10 Mar 2011
Total Posts: 114
15 Aug 2013 02:04 PM
Amen. Thank you.
Report Abuse
funnymouse7 is not online. funnymouse7
Joined: 17 Mar 2011
Total Posts: 1741
15 Aug 2013 02:06 PM
oh and if you click the green play button while you have destroy() on the map wont come back when you press the pink back button
Report Abuse
Mixer103 is not online. Mixer103
Joined: 10 Mar 2011
Total Posts: 114
15 Aug 2013 02:06 PM
Wait, sorry, just a little bit more, I know your basically making it for me, but I am learning steadily. Let's say I want to make this only triggered by a certain team, and like I know how to destroy the map, but let's say after a certain time limit. Would I do like wait 50 then map:destroy()
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
15 Aug 2013 02:07 PM
But.... 1) It's touch button,
2)It destroys only a clone of map.
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
15 Aug 2013 02:08 PM
@Mixer. Using debris service would be nicer and more efficient.


game:GetService("Debris"):AddItem(map,50)
Report Abuse
Mixer103 is not online. Mixer103
Joined: 10 Mar 2011
Total Posts: 114
15 Aug 2013 02:08 PM
So the touch button can't be limited to only a certain team?
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
15 Aug 2013 02:11 PM
It can be.

designatedTeamColor = game:GetService("Teams")["Team name here"]

--Rest of code

if game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor == designatedTeamColor then


--rest of code(also remember to have 'end' for that if line.
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