testplace.rbxlx 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. <roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
  2. <External>null</External>
  3. <External>nil</External>
  4. <Item class="Workspace" referent="12">
  5. <Properties>
  6. <bool name="AllowThirdPartySales">false</bool>
  7. <token name="AutoJointsMode">0</token>
  8. <string name="CollisionGroups">Default^0^1</string>
  9. <Ref name="CurrentCamera">RBXC2F6EB3900D249C9AF14DE3EC7F69C49</Ref>
  10. <double name="DistributedGameTime">0</double>
  11. <bool name="ExplicitAutoJoints">true</bool>
  12. <float name="FallenPartsDestroyHeight">-500</float>
  13. <bool name="FilteringEnabled">true</bool>
  14. <float name="Gravity">196.199997</float>
  15. <CoordinateFrame name="ModelInPrimary">
  16. <X>0</X>
  17. <Y>0</Y>
  18. <Z>0</Z>
  19. <R00>1</R00>
  20. <R01>0</R01>
  21. <R02>0</R02>
  22. <R10>0</R10>
  23. <R11>1</R11>
  24. <R12>0</R12>
  25. <R20>0</R20>
  26. <R21>0</R21>
  27. <R22>1</R22>
  28. </CoordinateFrame>
  29. <string name="Name">Workspace</string>
  30. <Ref name="PrimaryPart">null</Ref>
  31. <bool name="StreamingEnabled">false</bool>
  32. <int name="StreamingMinRadius">64</int>
  33. <token name="StreamingPauseMode">0</token>
  34. <int name="StreamingTargetRadius">1024</int>
  35. <BinaryString name="Tags"></BinaryString>
  36. <bool name="TemporaryLegacyPhysicsSolverOverrideStreaming">false</bool>
  37. <bool name="TerrainWeldsFixed">true</bool>
  38. </Properties>
  39. <Item class="Camera" referent="RBXC2F6EB3900D249C9AF14DE3EC7F69C49">
  40. <Properties>
  41. <CoordinateFrame name="CFrame">
  42. <X>-62.4867401</X>
  43. <Y>21.5452213</Y>
  44. <Z>77.6325226</Z>
  45. <R00>0.783173859</R00>
  46. <R01>0.175678894</R01>
  47. <R02>-0.596469402</R02>
  48. <R10>-0</R10>
  49. <R11>0.959258139</R11>
  50. <R12>0.2825315</R12>
  51. <R20>0.621802866</R20>
  52. <R21>-0.221271291</R21>
  53. <R22>0.751265824</R22>
  54. </CoordinateFrame>
  55. <Ref name="CameraSubject">null</Ref>
  56. <token name="CameraType">0</token>
  57. <float name="FieldOfView">70</float>
  58. <CoordinateFrame name="Focus">
  59. <X>-61.2938004</X>
  60. <Y>20.9801579</Y>
  61. <Z>76.1299896</Z>
  62. <R00>1</R00>
  63. <R01>0</R01>
  64. <R02>0</R02>
  65. <R10>0</R10>
  66. <R11>1</R11>
  67. <R12>0</R12>
  68. <R20>0</R20>
  69. <R21>0</R21>
  70. <R22>1</R22>
  71. </CoordinateFrame>
  72. <bool name="HeadLocked">true</bool>
  73. <float name="HeadScale">1</float>
  74. <string name="Name">Camera</string>
  75. <BinaryString name="Tags"></BinaryString>
  76. </Properties>
  77. </Item>
  78. <Item class="Part" referent="13">
  79. <Properties>
  80. <bool name="Anchored">true</bool>
  81. <float name="BackParamA">-0.5</float>
  82. <float name="BackParamB">0.5</float>
  83. <token name="BackSurface">0</token>
  84. <token name="BackSurfaceInput">0</token>
  85. <float name="BottomParamA">-0.5</float>
  86. <float name="BottomParamB">0.5</float>
  87. <token name="BottomSurface">4</token>
  88. <token name="BottomSurfaceInput">0</token>
  89. <CoordinateFrame name="CFrame">
  90. <X>0</X>
  91. <Y>-10</Y>
  92. <Z>0</Z>
  93. <R00>1</R00>
  94. <R01>0</R01>
  95. <R02>0</R02>
  96. <R10>0</R10>
  97. <R11>1</R11>
  98. <R12>0</R12>
  99. <R20>0</R20>
  100. <R21>0</R21>
  101. <R22>1</R22>
  102. </CoordinateFrame>
  103. <bool name="CanCollide">true</bool>
  104. <bool name="CastShadow">true</bool>
  105. <int name="CollisionGroupId">0</int>
  106. <Color3uint8 name="Color3uint8">4280778310</Color3uint8>
  107. <PhysicalProperties name="CustomPhysicalProperties">
  108. <CustomPhysics>false</CustomPhysics>
  109. </PhysicalProperties>
  110. <float name="FrontParamA">-0.5</float>
  111. <float name="FrontParamB">0.5</float>
  112. <token name="FrontSurface">0</token>
  113. <token name="FrontSurfaceInput">0</token>
  114. <float name="LeftParamA">-0.5</float>
  115. <float name="LeftParamB">0.5</float>
  116. <token name="LeftSurface">0</token>
  117. <token name="LeftSurfaceInput">0</token>
  118. <bool name="Locked">true</bool>
  119. <bool name="Massless">false</bool>
  120. <token name="Material">256</token>
  121. <string name="Name">Baseplate</string>
  122. <float name="Reflectance">0</float>
  123. <float name="RightParamA">-0.5</float>
  124. <float name="RightParamB">0.5</float>
  125. <token name="RightSurface">0</token>
  126. <token name="RightSurfaceInput">0</token>
  127. <int name="RootPriority">0</int>
  128. <Vector3 name="RotVelocity">
  129. <X>0</X>
  130. <Y>0</Y>
  131. <Z>0</Z>
  132. </Vector3>
  133. <BinaryString name="Tags"></BinaryString>
  134. <float name="TopParamA">-0.5</float>
  135. <float name="TopParamB">0.5</float>
  136. <token name="TopSurface">3</token>
  137. <token name="TopSurfaceInput">0</token>
  138. <float name="Transparency">0</float>
  139. <Vector3 name="Velocity">
  140. <X>0</X>
  141. <Y>0</Y>
  142. <Z>0</Z>
  143. </Vector3>
  144. <token name="formFactorRaw">1</token>
  145. <token name="shape">1</token>
  146. <Vector3 name="size">
  147. <X>512</X>
  148. <Y>20</Y>
  149. <Z>512</Z>
  150. </Vector3>
  151. </Properties>
  152. </Item>
  153. <Item class="Terrain" referent="RBX2FBB7F3A9CD24531BDC5FFD8FEBC70A8">
  154. <Properties>
  155. <bool name="Anchored">true</bool>
  156. <float name="BackParamA">-0.5</float>
  157. <float name="BackParamB">0.5</float>
  158. <token name="BackSurface">0</token>
  159. <token name="BackSurfaceInput">0</token>
  160. <float name="BottomParamA">-0.5</float>
  161. <float name="BottomParamB">0.5</float>
  162. <token name="BottomSurface">4</token>
  163. <token name="BottomSurfaceInput">0</token>
  164. <CoordinateFrame name="CFrame">
  165. <X>0</X>
  166. <Y>0</Y>
  167. <Z>0</Z>
  168. <R00>1</R00>
  169. <R01>0</R01>
  170. <R02>0</R02>
  171. <R10>0</R10>
  172. <R11>1</R11>
  173. <R12>0</R12>
  174. <R20>0</R20>
  175. <R21>0</R21>
  176. <R22>1</R22>
  177. </CoordinateFrame>
  178. <bool name="CanCollide">true</bool>
  179. <bool name="CastShadow">true</bool>
  180. <int name="CollisionGroupId">0</int>
  181. <Color3uint8 name="Color3uint8">4288914085</Color3uint8>
  182. <PhysicalProperties name="CustomPhysicalProperties">
  183. <CustomPhysics>false</CustomPhysics>
  184. </PhysicalProperties>
  185. <float name="FrontParamA">-0.5</float>
  186. <float name="FrontParamB">0.5</float>
  187. <token name="FrontSurface">0</token>
  188. <token name="FrontSurfaceInput">0</token>
  189. <float name="LeftParamA">-0.5</float>
  190. <float name="LeftParamB">0.5</float>
  191. <token name="LeftSurface">0</token>
  192. <token name="LeftSurfaceInput">0</token>
  193. <bool name="Locked">true</bool>
  194. <bool name="Massless">false</bool>
  195. <token name="Material">256</token>
  196. <BinaryString name="MaterialColors"><![CDATA[AAAAAAAAan8/P39rf2Y/ilY+j35fi21PZmxvZbDqw8faiVpHOi4kHh4lZlw76JxKc3trhHta
  197. gcLgc4RKxr21zq2UlJSM]]></BinaryString>
  198. <string name="Name">Terrain</string>
  199. <BinaryString name="PhysicsGrid">AgMAAAAAAAAAAAAAAAA=</BinaryString>
  200. <float name="Reflectance">0</float>
  201. <float name="RightParamA">-0.5</float>
  202. <float name="RightParamB">0.5</float>
  203. <token name="RightSurface">0</token>
  204. <token name="RightSurfaceInput">0</token>
  205. <int name="RootPriority">0</int>
  206. <Vector3 name="RotVelocity">
  207. <X>0</X>
  208. <Y>0</Y>
  209. <Z>0</Z>
  210. </Vector3>
  211. <BinaryString name="SmoothGrid">AQU=</BinaryString>
  212. <BinaryString name="Tags"></BinaryString>
  213. <float name="TopParamA">-0.5</float>
  214. <float name="TopParamB">0.5</float>
  215. <token name="TopSurface">3</token>
  216. <token name="TopSurfaceInput">0</token>
  217. <float name="Transparency">0</float>
  218. <Vector3 name="Velocity">
  219. <X>0</X>
  220. <Y>0</Y>
  221. <Z>0</Z>
  222. </Vector3>
  223. <Color3 name="WaterColor">
  224. <R>0.0500000007</R>
  225. <G>0.330000013</G>
  226. <B>0.360000014</B>
  227. </Color3>
  228. <float name="WaterReflectance">1</float>
  229. <float name="WaterTransparency">0.300000012</float>
  230. <float name="WaterWaveSize">0.150000006</float>
  231. <float name="WaterWaveSpeed">10</float>
  232. <Vector3 name="size">
  233. <X>2044</X>
  234. <Y>252</Y>
  235. <Z>2044</Z>
  236. </Vector3>
  237. </Properties>
  238. </Item>
  239. </Item>
  240. <Item class="SoundService" referent="11">
  241. <Properties>
  242. <token name="AmbientReverb">0</token>
  243. <float name="DistanceFactor">3.32999992</float>
  244. <float name="DopplerScale">1</float>
  245. <string name="Name">SoundService</string>
  246. <bool name="RespectFilteringEnabled">true</bool>
  247. <float name="RolloffScale">1</float>
  248. <BinaryString name="Tags"></BinaryString>
  249. </Properties>
  250. </Item>
  251. <Item class="NonReplicatedCSGDictionaryService" referent="RBXEF03CDA1206F41B3B680FEBADCA4DA13">
  252. <Properties>
  253. <string name="Name">NonReplicatedCSGDictionaryService</string>
  254. <BinaryString name="Tags"></BinaryString>
  255. </Properties>
  256. </Item>
  257. <Item class="CSGDictionaryService" referent="RBX80B0785DF42C4268AEC9ADBE8CC7A8DD">
  258. <Properties>
  259. <string name="Name">CSGDictionaryService</string>
  260. <BinaryString name="Tags"></BinaryString>
  261. </Properties>
  262. </Item>
  263. <Item class="Chat" referent="RBXFAC6BA9A1EE04439BDDC86AFE9682DBE">
  264. <Properties>
  265. <bool name="BubbleChatEnabled">false</bool>
  266. <bool name="LoadDefaultChat">true</bool>
  267. <string name="Name">Chat</string>
  268. <BinaryString name="Tags"></BinaryString>
  269. </Properties>
  270. </Item>
  271. <Item class="TimerService" referent="RBXE102D2BFF7A64877864632C8E84415FC">
  272. <Properties>
  273. <string name="Name">Instance</string>
  274. <BinaryString name="Tags"></BinaryString>
  275. </Properties>
  276. </Item>
  277. <Item class="Players" referent="RBXA050EA650F40483D96EF48E279913A24">
  278. <Properties>
  279. <bool name="CharacterAutoLoads">true</bool>
  280. <int name="MaxPlayersInternal">12</int>
  281. <string name="Name">Players</string>
  282. <int name="PreferredPlayersInternal">0</int>
  283. <float name="RespawnTime">5</float>
  284. <BinaryString name="Tags"></BinaryString>
  285. </Properties>
  286. </Item>
  287. <Item class="ReplicatedFirst" referent="RBX3BC0FC0E6E9B42C8B59610B1BDE7E727">
  288. <Properties>
  289. <string name="Name">ReplicatedFirst</string>
  290. <BinaryString name="Tags"></BinaryString>
  291. </Properties>
  292. </Item>
  293. <Item class="TweenService" referent="RBX9270E4DE84F148898EFBEAC9D59B8646">
  294. <Properties>
  295. <string name="Name">TweenService</string>
  296. <BinaryString name="Tags"></BinaryString>
  297. </Properties>
  298. </Item>
  299. <Item class="StarterPlayer" referent="RBXD93651594C084CC8A2BE586850F5E914">
  300. <Properties>
  301. <bool name="AllowCustomAnimations">true</bool>
  302. <bool name="AutoJumpEnabled">true</bool>
  303. <float name="CameraMaxZoomDistance">400</float>
  304. <float name="CameraMinZoomDistance">0.5</float>
  305. <token name="CameraMode">0</token>
  306. <float name="CharacterJumpHeight">7.19999981</float>
  307. <float name="CharacterJumpPower">50</float>
  308. <float name="CharacterMaxSlopeAngle">89</float>
  309. <bool name="CharacterUseJumpPower">true</bool>
  310. <float name="CharacterWalkSpeed">16</float>
  311. <token name="DevCameraOcclusionMode">0</token>
  312. <token name="DevComputerCameraMovementMode">0</token>
  313. <token name="DevComputerMovementMode">0</token>
  314. <token name="DevTouchCameraMovementMode">0</token>
  315. <token name="DevTouchMovementMode">0</token>
  316. <bool name="EnableMouseLockOption">true</bool>
  317. <int64 name="GameSettingsAssetIDFace">0</int64>
  318. <int64 name="GameSettingsAssetIDHead">0</int64>
  319. <int64 name="GameSettingsAssetIDLeftArm">0</int64>
  320. <int64 name="GameSettingsAssetIDLeftLeg">0</int64>
  321. <int64 name="GameSettingsAssetIDPants">0</int64>
  322. <int64 name="GameSettingsAssetIDRightArm">0</int64>
  323. <int64 name="GameSettingsAssetIDRightLeg">0</int64>
  324. <int64 name="GameSettingsAssetIDShirt">0</int64>
  325. <int64 name="GameSettingsAssetIDTeeShirt">0</int64>
  326. <int64 name="GameSettingsAssetIDTorso">0</int64>
  327. <token name="GameSettingsAvatar">1</token>
  328. <token name="GameSettingsR15Collision">0</token>
  329. <NumberRange name="GameSettingsScaleRangeBodyType">0 1 </NumberRange>
  330. <NumberRange name="GameSettingsScaleRangeHead">0.95 1 </NumberRange>
  331. <NumberRange name="GameSettingsScaleRangeHeight">0.9 1.05 </NumberRange>
  332. <NumberRange name="GameSettingsScaleRangeProportion">0 1 </NumberRange>
  333. <NumberRange name="GameSettingsScaleRangeWidth">0.7 1 </NumberRange>
  334. <float name="HealthDisplayDistance">100</float>
  335. <bool name="LoadCharacterAppearance">true</bool>
  336. <string name="Name">StarterPlayer</string>
  337. <float name="NameDisplayDistance">100</float>
  338. <BinaryString name="Tags"></BinaryString>
  339. <bool name="UserEmotesEnabled">true</bool>
  340. </Properties>
  341. <Item class="StarterPlayerScripts" referent="RBXB810DF52363D479B854AFC68B74215D5">
  342. <Properties>
  343. <string name="Name">StarterPlayerScripts</string>
  344. <BinaryString name="Tags"></BinaryString>
  345. </Properties>
  346. </Item>
  347. <Item class="StarterCharacterScripts" referent="RBX10CD1ACDDDD64E9496045491574B227C">
  348. <Properties>
  349. <string name="Name">StarterCharacterScripts</string>
  350. <BinaryString name="Tags"></BinaryString>
  351. </Properties>
  352. </Item>
  353. </Item>
  354. <Item class="StarterPack" referent="RBXE6A0D91D16934C08B3B6FD5F59B93079">
  355. <Properties>
  356. <string name="Name">StarterPack</string>
  357. <BinaryString name="Tags"></BinaryString>
  358. </Properties>
  359. </Item>
  360. <Item class="StarterGui" referent="RBX14FE59EBD3FC4F17BEB4AF0A299A4B13">
  361. <Properties>
  362. <string name="Name">StarterGui</string>
  363. <bool name="ResetPlayerGuiOnSpawn">true</bool>
  364. <token name="ScreenOrientation">2</token>
  365. <bool name="ShowDevelopmentGui">true</bool>
  366. <BinaryString name="Tags"></BinaryString>
  367. </Properties>
  368. </Item>
  369. <Item class="LocalizationService" referent="RBX7320A75E17D14C87B718BB1F7FEFC06E">
  370. <Properties>
  371. <string name="Name">LocalizationService</string>
  372. <BinaryString name="Tags"></BinaryString>
  373. </Properties>
  374. </Item>
  375. <Item class="TeleportService" referent="RBX07386C71C34E45EA927C4861CF318890">
  376. <Properties>
  377. <string name="Name">Teleport Service</string>
  378. <BinaryString name="Tags"></BinaryString>
  379. </Properties>
  380. </Item>
  381. <Item class="CollectionService" referent="RBX5466D1D48457467CA180B1481F39965D">
  382. <Properties>
  383. <string name="Name">CollectionService</string>
  384. <BinaryString name="Tags"></BinaryString>
  385. </Properties>
  386. </Item>
  387. <Item class="PhysicsService" referent="RBX3D2749D41CAB4759A41519445663FF53">
  388. <Properties>
  389. <string name="Name">PhysicsService</string>
  390. <BinaryString name="Tags"></BinaryString>
  391. </Properties>
  392. </Item>
  393. <Item class="Geometry" referent="RBX96447A0E13CD405589A9718DCF911282">
  394. <Properties>
  395. <string name="Name">Geometry</string>
  396. <BinaryString name="Tags"></BinaryString>
  397. </Properties>
  398. </Item>
  399. <Item class="InsertService" referent="RBX0F319A2DF7BB403E8CD5A3E0512D3133">
  400. <Properties>
  401. <bool name="AllowClientInsertModels">false</bool>
  402. <bool name="AllowInsertFreeModels">false</bool>
  403. <string name="Name">InsertService</string>
  404. <BinaryString name="Tags"></BinaryString>
  405. </Properties>
  406. </Item>
  407. <Item class="GamePassService" referent="RBXA2262298A12F4B91A1172278F74AE3B5">
  408. <Properties>
  409. <string name="Name">GamePassService</string>
  410. <BinaryString name="Tags"></BinaryString>
  411. </Properties>
  412. </Item>
  413. <Item class="Debris" referent="RBX176097F865EA4EEEA1631A6B40593D07">
  414. <Properties>
  415. <int name="MaxItems">1000</int>
  416. <string name="Name">Debris</string>
  417. <BinaryString name="Tags"></BinaryString>
  418. </Properties>
  419. </Item>
  420. <Item class="CookiesService" referent="RBX97316A8615A64A55B4DD994E5F0868C3">
  421. <Properties>
  422. <string name="Name">CookiesService</string>
  423. <BinaryString name="Tags"></BinaryString>
  424. </Properties>
  425. </Item>
  426. <Item class="VRService" referent="RBX34EB36C733E843B78B59652257CA00FF">
  427. <Properties>
  428. <string name="Name">VRService</string>
  429. <BinaryString name="Tags"></BinaryString>
  430. </Properties>
  431. </Item>
  432. <Item class="ContextActionService" referent="RBX7282EC4D4CD040AF8E588D42347A32CE">
  433. <Properties>
  434. <string name="Name">ContextActionService</string>
  435. <BinaryString name="Tags"></BinaryString>
  436. </Properties>
  437. </Item>
  438. <Item class="ScriptService" referent="RBX47D91C1820E6435F968027EC3C13D7E8">
  439. <Properties>
  440. <string name="Name">Instance</string>
  441. <BinaryString name="Tags"></BinaryString>
  442. </Properties>
  443. </Item>
  444. <Item class="AssetService" referent="RBXAC343E600D5F4BD397118562A01254AB">
  445. <Properties>
  446. <string name="Name">AssetService</string>
  447. <BinaryString name="Tags"></BinaryString>
  448. </Properties>
  449. </Item>
  450. <Item class="TouchInputService" referent="RBX300B6F4DE0374DD39F3414DD8CF43D9C">
  451. <Properties>
  452. <string name="Name">TouchInputService</string>
  453. <BinaryString name="Tags"></BinaryString>
  454. </Properties>
  455. </Item>
  456. <Item class="Selection" referent="RBX0D56B28A3FE640328275C73698188A94">
  457. <Properties>
  458. <string name="Name">Selection</string>
  459. <BinaryString name="Tags"></BinaryString>
  460. </Properties>
  461. </Item>
  462. <Item class="ServerScriptService" referent="9">
  463. <Properties>
  464. <bool name="LoadStringEnabled">false</bool>
  465. <string name="Name">ServerScriptService</string>
  466. <BinaryString name="Tags"></BinaryString>
  467. </Properties>
  468. <Item class="Script" referent="10">
  469. <Properties>
  470. <bool name="Disabled">false</bool>
  471. <Content name="LinkedSource"><null></null></Content>
  472. <string name="Name">Test</string>
  473. <string name="ScriptGuid">{53EF4D03-BE2B-4E3B-A821-82D8D88F8DC1}</string>
  474. <ProtectedString name="Source"><![CDATA[local ReplicatedStorage = game:GetService("ReplicatedStorage")
  475. local lib = ReplicatedStorage:WaitForChild("lib")
  476. local PizzaAlpaca = require(lib:WaitForChild("PizzaAlpaca"))
  477. local TestModule = PizzaAlpaca.GameModule:extend("TestModule")
  478. function TestModule:preInit()
  479. print("testmodule pre-initialized")
  480. end
  481. function TestModule:init()
  482. print("testmodule initialized")
  483. end
  484. function TestModule:postInit()
  485. print("testmodule post-initialized")
  486. end
  487. local core = PizzaAlpaca.GameCore.new()
  488. core:registerModule(TestModule)
  489. core:registerModule("invalid")
  490. core:load()]]></ProtectedString>
  491. <BinaryString name="Tags"></BinaryString>
  492. </Properties>
  493. </Item>
  494. </Item>
  495. <Item class="ServerStorage" referent="RBXB3A20CDB59F843A1BAD48E3885C6A6B1">
  496. <Properties>
  497. <string name="Name">ServerStorage</string>
  498. <BinaryString name="Tags"></BinaryString>
  499. </Properties>
  500. </Item>
  501. <Item class="ReplicatedStorage" referent="2">
  502. <Properties>
  503. <string name="Name">ReplicatedStorage</string>
  504. <BinaryString name="Tags"></BinaryString>
  505. </Properties>
  506. <Item class="Folder" referent="3">
  507. <Properties>
  508. <string name="Name">lib</string>
  509. <BinaryString name="Tags"></BinaryString>
  510. </Properties>
  511. <Item class="ModuleScript" referent="4">
  512. <Properties>
  513. <Content name="LinkedSource"><null></null></Content>
  514. <string name="Name">PizzaAlpaca</string>
  515. <string name="ScriptGuid">{C21E6DC9-A410-46C4-9932-D09ACDFE734F}</string>
  516. <ProtectedString name="Source"><![CDATA[return {
  517. GameModule = require(script.GameModule),
  518. GameCore = require(script.GameCore),
  519. }]]></ProtectedString>
  520. <BinaryString name="Tags"></BinaryString>
  521. </Properties>
  522. <Item class="ModuleScript" referent="5">
  523. <Properties>
  524. <Content name="LinkedSource"><null></null></Content>
  525. <string name="Name">GameCore</string>
  526. <string name="ScriptGuid">{37AE6B5B-8142-432D-B433-F8FE490B242D}</string>
  527. <ProtectedString name="Source"><![CDATA[local src = script.Parent
  528. local compileSubmodules = require(src:WaitForChild("compileSubmodules"))
  529. local callOnAll = require(src:WaitForChild("callOnAll"))
  530. local GameCore = {}
  531. local errors = {
  532. invalidArgument = "Invalid argument: [%s]. expected: [%s]."
  533. }
  534. local function instanceModule(class, core)
  535. return setmetatable({
  536. core = core
  537. },{__index = class, __tostring = getmetatable(class).__tostring})
  538. end
  539. function GameCore.new()
  540. local core = setmetatable({
  541. _moduleClasses = {},
  542. _modules = {},
  543. }, {__index = GameCore})
  544. return core
  545. end
  546. function GameCore:registerModule(moduleClass)
  547. local moduleClassType = typeof(moduleClass)
  548. if moduleClassType == "table" then
  549. assert(moduleClass.__gamemodule,
  550. errors.invalidArgument:format(
  551. tostring(moduleClass),
  552. "GameModule class"
  553. ),
  554. 2
  555. )
  556. self._moduleClasses[moduleClass.name] = moduleClass
  557. elseif moduleClassType == "Instance" then
  558. assert(moduleClass:IsA("ModuleScript"),
  559. errors.invalidArgument:format(
  560. moduleClass:GetFullName(),
  561. "ModuleScript"
  562. ),
  563. 2
  564. )
  565. local requiredModuleClass = require(moduleClass)
  566. self:registerModule(requiredModuleClass) -- register the class
  567. else
  568. error(errors.invalidArgument:format(
  569. tostring(moduleClass),
  570. "GameModule class or ModuleScipt of GameModule class"),
  571. 2
  572. )
  573. end
  574. end
  575. function GameCore:registerChildrenAsModules(root)
  576. for _, module in pairs(compileSubmodules(root,true)) do
  577. self:registerModule(module)
  578. end
  579. end
  580. function GameCore:instanceAllModules()
  581. -- instance modules
  582. for name, class in pairs(self._moduleClasses) do
  583. self._modules[name] = instanceModule(class, self)
  584. end
  585. end
  586. function GameCore:getModule(name)
  587. if not self._modules[name] then
  588. warn(("No such module %s"):format(tostring(name)))
  589. end
  590. return self._modules[name]
  591. end
  592. function GameCore:callOnModules(methodName)
  593. callOnAll(self._modules, methodName)
  594. end
  595. function GameCore:load()
  596. self:instanceAllModules()
  597. self:callOnModules("preInit")
  598. self:callOnModules("init")
  599. self:callOnModules("postInit")
  600. end
  601. return GameCore]]></ProtectedString>
  602. <BinaryString name="Tags"></BinaryString>
  603. </Properties>
  604. </Item>
  605. <Item class="ModuleScript" referent="6">
  606. <Properties>
  607. <Content name="LinkedSource"><null></null></Content>
  608. <string name="Name">GameModule</string>
  609. <string name="ScriptGuid">{D869675A-7656-47D1-B132-3A592D46FBCB}</string>
  610. <ProtectedString name="Source"><![CDATA[-- this type of class extension thing is inspired by Roact's component class, check it out:
  611. -- https://github.com/Roblox/roact/blob/master/src/Component.lua
  612. local GameModule = {}
  613. local gameModuleMetatable = {}
  614. function gameModuleMetatable:__tostring()
  615. return self.name
  616. end
  617. function GameModule:extend(name)
  618. local newModule = {name = name, __gamemodule = true}
  619. for k,v in pairs(self) do
  620. if k ~= "extend" then -- modules shouldnt extend other modules that's evil please do not do that.
  621. newModule[k] = v
  622. end
  623. end
  624. setmetatable(newModule, gameModuleMetatable)
  625. return newModule
  626. end
  627. -- This is where you setup this module and make it ready for other modules to interact with.
  628. -- It is not safe to interact with other modules at this step, but you can create references to them
  629. function GameModule:preInit()
  630. return
  631. end
  632. -- This is where you should do this module's work, setup the behavior
  633. -- this module is responsible for.
  634. -- it is safe to interact with other modules at this stage but their behaviors
  635. -- may not yet be setup. If your module is contingent on another module being
  636. -- finished setting up its behavior, do that in postInit.
  637. function GameModule:init()
  638. return
  639. end
  640. -- This is where you should interact with other modules.
  641. function GameModule:postInit()
  642. return
  643. end
  644. return GameModule]]></ProtectedString>
  645. <BinaryString name="Tags"></BinaryString>
  646. </Properties>
  647. </Item>
  648. <Item class="ModuleScript" referent="7">
  649. <Properties>
  650. <Content name="LinkedSource"><null></null></Content>
  651. <string name="Name">callOnAll</string>
  652. <string name="ScriptGuid">{D30C806C-1A7E-454F-B2FE-B49578E3860F}</string>
  653. <ProtectedString name="Source"><![CDATA[return function(table, methodname, ...)
  654. for _, v in pairs(table) do
  655. v[methodname](v, ...)
  656. end
  657. end]]></ProtectedString>
  658. <BinaryString name="Tags"></BinaryString>
  659. </Properties>
  660. </Item>
  661. <Item class="ModuleScript" referent="8">
  662. <Properties>
  663. <Content name="LinkedSource"><null></null></Content>
  664. <string name="Name">compileSubmodules</string>
  665. <string name="ScriptGuid">{2BD0315F-27FC-47BB-A139-0D86368291E0}</string>
  666. <ProtectedString name="Source"><![CDATA[local errors = {
  667. IllegalArgument = "Argument 1 must be an instance, got %s",
  668. }
  669. return function(root, recurseThroughFolders)
  670. assert(root, errors.IllegalArgument:format(typeof(root)))
  671. assert(typeof(root) == "Instance", errors.IllegalArgument:format(typeof(root)))
  672. local modules = {}
  673. local function compileSubmodules(instance)
  674. for _, child in pairs(instance:GetChildren()) do
  675. if child:IsA("ModuleScript") then
  676. local requiredModule = require(child)
  677. modules[child] = requiredModule
  678. elseif child:IsA("Folder") and recurseThroughFolders then
  679. compileSubmodules(child)
  680. end
  681. end
  682. end
  683. compileSubmodules(root)
  684. return modules
  685. end]]></ProtectedString>
  686. <BinaryString name="Tags"></BinaryString>
  687. </Properties>
  688. </Item>
  689. </Item>
  690. </Item>
  691. </Item>
  692. <Item class="LuaWebService" referent="RBX198BE965CF0C417391585681447D12B3">
  693. <Properties>
  694. <string name="Name">Instance</string>
  695. <BinaryString name="Tags"></BinaryString>
  696. </Properties>
  697. </Item>
  698. <Item class="Lighting" referent="1">
  699. <Properties>
  700. <Color3 name="Ambient">
  701. <R>0</R>
  702. <G>0</G>
  703. <B>0</B>
  704. </Color3>
  705. <float name="Brightness">2</float>
  706. <Color3 name="ColorShift_Bottom">
  707. <R>0</R>
  708. <G>0</G>
  709. <B>0</B>
  710. </Color3>
  711. <Color3 name="ColorShift_Top">
  712. <R>0</R>
  713. <G>0</G>
  714. <B>0</B>
  715. </Color3>
  716. <float name="ExposureCompensation">0</float>
  717. <Color3 name="FogColor">
  718. <R>0.75</R>
  719. <G>0.75</G>
  720. <B>0.75</B>
  721. </Color3>
  722. <float name="FogEnd">100000</float>
  723. <float name="FogStart">0</float>
  724. <float name="GeographicLatitude">41.7332993</float>
  725. <bool name="GlobalShadows">true</bool>
  726. <bool name="LegacyOutlines">false</bool>
  727. <string name="Name">Lighting</string>
  728. <Color3 name="OutdoorAmbient">
  729. <R>0.5</R>
  730. <G>0.5</G>
  731. <B>0.5</B>
  732. </Color3>
  733. <bool name="Outlines">false</bool>
  734. <float name="ShadowSoftness">0.5</float>
  735. <BinaryString name="Tags"></BinaryString>
  736. <token name="Technology">1</token>
  737. <string name="TimeOfDay">14:00:00</string>
  738. </Properties>
  739. </Item>
  740. <Item class="HttpService" referent="0">
  741. <Properties>
  742. <bool name="HttpEnabled">true</bool>
  743. <string name="Name">HttpService</string>
  744. <BinaryString name="Tags"></BinaryString>
  745. </Properties>
  746. </Item>
  747. <Item class="DataStoreService" referent="RBXBDC2F01AB8924C539298F7A08BDB1E5E">
  748. <Properties>
  749. <bool name="AutomaticRetry">true</bool>
  750. <bool name="LegacyNamingScheme">false</bool>
  751. <string name="Name">DataStoreService</string>
  752. <BinaryString name="Tags"></BinaryString>
  753. </Properties>
  754. </Item>
  755. </roblox>