Models won't clone from lighting?
So, In a test game I'm making, you spawn in a room. You touch a button, and it picks a room randomly from lighting, clones it in, teleports you to the room, and deletes the last room you were in. There's another button in the new room, which does the same thing as the last room (so its basically an endless assortment of rooms). This works fine in test mode, however in an actual server, it fails to work. When i hit the button, it teleports me to the middle of the baseplate, and no room spawns in. A singular script is incharge of the random room picking. This is the script:
03 | t.Changed:connect( function () |
04 | print ( "Changing Room..." ) |
05 | local r = math.random( 1 , 3 ) |
07 | game.Lighting.defroom 1 :Clone().Parent = workspace |
08 | game.Workspace.Player.Torso.CFrame = CFrame.new(game.Workspace.defroom 1. spawn.Position) |
10 | game.Lighting.defroom 2 :Clone().Parent = workspace |
11 | game.Workspace.Player.Torso.CFrame = CFrame.new(game.Workspace.defroom 2. spawn.Position) |
13 | game.Lighting.defroom 3 :Clone().Parent = workspace |
14 | game.Workspace.Player.Torso.CFrame = CFrame.new(game.Workspace.defroom 3. spawn.Position) |
(NOTE: The script is located in Workspace > ValueHold (A folder I made) > RoomCount (A number Value) > This script)