|
| 25 Mar 2015 02:45 PM |
game.Players.ChildAdded:connect(function(player) player.Chatted:connect(function(chat) if player.Name == "FailingClock" then if string.lower(chat) == "open/obby2" then if not game.Workspace:FindFirstChild("Obby2") then game.Lighting["Obby2"]:Clone().Parent = game.Workspace end elseif string.lower(chat) == "close/obby2" then if game.Workspace:FindFirstChild("Obby2") then game.Workspace["Obby2"]:Remove() end end end end) end) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 25 Mar 2015 02:50 PM |
| Use :Destroy(), not :Remove(). But yeah, it's fine. |
|
|
| Report Abuse |
|
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 25 Mar 2015 02:51 PM |
| Ignore him; he's a troll from what I've seen of him. Does it give *any* output at all? |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 25 Mar 2015 02:51 PM |
i dont see anything wrong yet after looking at it for a bit,
but you should replace game.Players.ChildAdded
with game.Players.PlayerAdded
just in case something else is added to players besides a player object
don't use lighting to store maps and stuff, use ServerStorage/ReplicatedStorage
and don't use remove, it is deprecated |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 02:51 PM |
| What about it isn't working? Are you getting errors? |
|
|
| Report Abuse |
|
|
| |
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 25 Mar 2015 02:58 PM |
also you forgot to use :MakeJoints
assuming your obby is a model like it should be |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 03:01 PM |
Are you sure the obby is in the right area inside workspace? Is 'Obby2' inside lighting filled with stuff? Maybe you goofed and deleted stuff inside, from what I can tell though, this script should work, aside from the game.Players.ChildAdded part; you should change that to game.Players.PlayerAdded
It is a script inside workspace... right? |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 25 Mar 2015 03:02 PM |
you forgot to give your model a position/cframe
so if your script is working correctly it just gets put at 0,0,0 |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Mar 2015 03:05 PM |
@instawin
If copied directly from lighting, it gets put in the place it was before it was put into lighting.
If I put a car at 100,20,-50 in lighting, then copy it and put the copy in workspace, it will be exactly like the original car; position, rotation, speed, all that jazz. |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 03:05 PM |
| Could it be that obby 1,2,3,4 and 5 are in a model together? |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 03:06 PM |
| Plan A.B, throw a bunch of print()'s in there and see what you get. That can solve about 50% of every scripters problems. |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2015 03:06 PM |
| Isn't there a model called "Obby2" directly inside lighting? |
|
|
| Report Abuse |
|
|