|
| 28 Nov 2013 02:06 PM |
function Check(Td) local LTd = Td local OTd = game.ServerStorage.Td:Clone() game.Players.PlayerRemoving:connect(function(p) if LTd.Owner.Value == p then LTd:Remove() OTd.Parent = workspace Check(OTd) end end) end
function search(obj) if obj.Name == "Owner" and obj.className == "ObjectValue" then Check(obj.Parent) end for i, v in pairs(obj:GetChildren()) do search(v); end end search(workspace);
the above script was made for me by galaxen. As hard as I try to understand it, I simply don't. Maybe I'm overthinking it. I don't know. The point of the script is to check all 6 maps to find which player left, and then set the clone's parent to workspace, replacing the used map. Now, the script does work, but for some reason, the cloned map wont allow new players to claim it. My only thought is that the map being cloned to workspace probably has the same name as another map. Maps are named accordingly Td1, Td2, etc, all the way to 6.
Anyone think they can fix this? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
|
| 29 Nov 2013 02:09 PM |
| uh... can you explain it a little more? I'm a bit confused.. |
|
|
| Report Abuse |
|
|
|
| 29 Nov 2013 08:08 PM |
the script clones a Td map when the server is started. The reset event fires when a player leaves, checking all of workspace for models that have an ObjectValue named Owner in them, which in this case is only the Td maps, and then removes that map and replaces it with the cloned one. For some reason, the maps only work once, because when a player leaves, the map that was placed into workspace to replace the old one doesnt allow new players to use it.
simple explanation is i don't know why. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|