Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.33 KB | None | 0 0
  1. --IMPORTANT THE MAPS YOU MAKE (which sould be a modle) must be uner ONE modle as in
  2.  
  3. -- ALL MAPS UNDER *_1_* Modle called Maps
  4. --  Lighting>Maps>Map1>parts of map
  5. --  Lighting>Maps>Map2>map parts
  6.  
  7. --With full commentary!
  8.  
  9. --Update (Aug. 10th) I updated the message, not the issue with the message not haveing a space is fixed.
  10.  
  11. --Update 1/4/11 I made it so welds don't break.
  12.  
  13. -- For the ROBLOX engine.
  14.  
  15.  
  16. -- Configuration ------------------------------------------------------------------------------------------
  17. local mapDirectory = game.Lighting.Maps -- This is where your maps are!
  18. local msg = Instance.new("Message") -- Makes a new message
  19. msg.Parent = game.Lighting -- Defines the messages parent
  20. local time = script.Time -- Defines what time is, which is the value under this
  21. -- Script ----------------------------------------------------------------------------------------------------
  22.  
  23.  
  24. --Da Loop--
  25. while true do  -- The Loop
  26. local maps = mapDirectory:getChildren()  -- Defins what maps means
  27. --And of Da Loop--
  28.  
  29.  
  30. -----This is the fail safe-----
  31. if #maps == 0 then   --Counts how many maps there are, if theres 0, removes da script.
  32.     print("Maps not found! Selfremoving...")   --lets you know whats going on
  33.     script:remove()  --removes the script
  34.     return
  35. end                        -- Ends this function
  36. -----Fail Safe Ends-----
  37.  
  38.  
  39. ---Part that picks da maps-----
  40. local pickedMap = maps[math.random(1, #maps)]  --Defines Pickedmap, as 1-# of maps
  41. local pickedMapClone = pickedMap:clone()          --defines what the picked mapcline is
  42. pickedMapClone.Parent = game.Workspace      -- defines the parent of the piced map
  43. pickedMapClone:makeJoints() -- required whenever you insert a model into the world, otherwise it falls apart (From Telamon)
  44. msg.Parent = game.Workspace  --makes a message
  45. msg.Text = "Map Change!"     --makes the text
  46. wait(3)                  --waits 3 seconds
  47. msg.Text = "Picked Map is " ..pickedMapClone.Name.."."   --makes the message of what map
  48. print("Map inserted: " .. pickedMap.Name)      --says when map is made
  49. wait(5)  --waits 5 secs.
  50.  
  51. msg.Parent = game.Lighting    
  52. wait(time.Value)                    --the value time is refrenced to the time of waitness
  53. pickedMapClone:remove()  --removes the cloned map
  54.  
  55.  
  56. end
  57.  
  58.  
  59.  
  60. --by Nate
  61. --Qestions? Comments? Feel free to PM me, I owuld love to help!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement