Advertisement
Ak8D

StarterScript

Mar 14th, 2013
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.76 KB | None | 0 0
  1. -- Creates all neccessary scripts for the gui on initial load, everything except build tools
  2. -- Created by Ben T. 10/29/10
  3. -- Please note that these are loaded in a specific order to diminish errors/perceived load time by user
  4. local scriptContext = game:GetService("ScriptContext")
  5. local touchEnabled = false
  6. pcall(function() touchEnabled = game:GetService("UserInputService").TouchEnabled end)
  7.  
  8. -- library registration
  9. scriptContext:AddCoreScript(60595695, scriptContext,"/Libraries/LibraryRegistration/LibraryRegistration")
  10.  
  11. local function waitForChild(instance, name)
  12.     while not instance:FindFirstChild(name) do
  13.         instance.ChildAdded:wait()
  14.     end
  15. end
  16. local function waitForProperty(instance, property)
  17.     while not instance[property] do
  18.         instance.Changed:wait()
  19.     end
  20. end
  21.  
  22. -- Responsible for tracking logging items
  23. local scriptContext = game:GetService("ScriptContext")
  24. scriptContext:AddCoreScript(59002209, scriptContext, "CoreScripts/Sections")
  25.  
  26. waitForChild(game:GetService("CoreGui"),"RobloxGui")
  27. local screenGui = game:GetService("CoreGui"):FindFirstChild("RobloxGui")
  28.  
  29. if not touchEnabled then
  30.     -- ToolTipper  (creates tool tips for gui)
  31.     scriptContext:AddCoreScript(36868950,screenGui,"CoreScripts/ToolTip")
  32.     -- SettingsScript
  33.     scriptContext:AddCoreScript(46295863,screenGui,"CoreScripts/Settings")
  34. end
  35.  
  36. -- MainBotChatScript
  37. scriptContext:AddCoreScript(39250920,screenGui,"CoreScripts/MainBotChatScript")
  38.  
  39. -- Popup Script
  40. scriptContext:AddCoreScript(48488451,screenGui,"CoreScripts/PopupScript")
  41. -- Friend Notification Script (probably can use this script to expand out to other notifications)
  42. scriptContext:AddCoreScript(48488398,screenGui,"CoreScripts/NotificationScript")
  43. -- Chat script
  44. scriptContext:AddCoreScript(97188756, screenGui, "CoreScripts/ChatScript") 
  45. -- Purchase Prompt Script
  46. scriptContext:AddCoreScript(107893730, screenGui, "CoreScripts/PurchasePromptScript")
  47.  
  48. if not touchEnabled then
  49.     -- New Player List
  50.     scriptContext:AddCoreScript(48488235,screenGui,"CoreScripts/PlayerListScript")
  51. elseif screenGui.AbsoluteSize.Y > 600 then  
  52.     -- New Player List
  53.     scriptContext:AddCoreScript(48488235,screenGui,"CoreScripts/PlayerListScript")
  54. else
  55.     delay(5, function()
  56.         if screenGui.AbsoluteSize.Y >= 600 then            
  57.             -- New Player List
  58.             scriptContext:AddCoreScript(48488235,screenGui,"CoreScripts/PlayerListScript")
  59.         end
  60.     end)
  61. end
  62.  
  63. if game.CoreGui.Version >= 3 then
  64.     -- Backpack Builder, creates most of the backpack gui
  65.     scriptContext:AddCoreScript(53878047,screenGui,"CoreScripts/BackpackScripts/BackpackBuilder")
  66.  
  67.     waitForChild(screenGui,"CurrentLoadout")
  68.     waitForChild(screenGui,"Backpack")
  69.     local Backpack = screenGui.Backpack
  70.    
  71.     -- Manager handles all big backpack state changes, other scripts subscribe to this and do things accordingly
  72.     if game.CoreGui.Version >= 7 then
  73.         scriptContext:AddCoreScript(89449093,Backpack,"CoreScripts/BackpackScripts/BackpackManager")
  74.     end
  75.    
  76.     -- Backpack Gear (handles all backpack gear tab stuff)
  77.     game:GetService("ScriptContext"):AddCoreScript(89449008,Backpack,"CoreScripts/BackpackScripts/BackpackGear")
  78.     -- Loadout Script, used for gear hotkeys
  79.     scriptContext:AddCoreScript(53878057,screenGui.CurrentLoadout,"CoreScripts/BackpackScripts/LoadoutScript")
  80.     if game.CoreGui.Version >= 8 then
  81.         -- Wardrobe script handles all character dressing operations
  82.         scriptContext:AddCoreScript(-1,Backpack,"CoreScripts/BackpackScripts/BackpackWardrobe")
  83.     end
  84. end
  85.  
  86. if touchEnabled then -- touch devices don't use same control frame
  87.     waitForChild(screenGui, 'ControlFrame')
  88.     waitForChild(screenGui.ControlFrame, 'BottomLeftControl')
  89.     screenGui.ControlFrame.BottomLeftControl.Visible = false
  90.  
  91.     waitForChild(screenGui.ControlFrame, 'TopLeftControl')
  92.     screenGui.ControlFrame.TopLeftControl.Visible = false
  93. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement