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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 10 Mar 2011 |
| Total Posts: 114 |
|
| |
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|