Advertisement
richblackpowner

BoomBox Giver

Apr 26th, 2019
3,813
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.06 KB | None | 0 0
  1. -- Converted using Mokiros's Model to Script plugin
  2. -- Converted string size: 4268
  3.  
  4. local Scripts = { function()
  5. local ClickerModule = require(343254562)
  6. local clickEvent = ClickerModule.RemoteEvent
  7. local interactiveParts = {}
  8. local activationDistance = 12
  9.  
  10. for i, v in pairs(script.Parent:GetChildren()) do
  11. if v.Name == "Interactive" then
  12. table.insert(interactiveParts, v)
  13. end
  14. end
  15.  
  16. local function distanceToCharacter(player, part)
  17. local character = player.Character
  18. if character then
  19. local torso = character:FindFirstChild("Torso")
  20. if torso then
  21. return((torso.Position - part.Position).magnitude)
  22. end
  23. end
  24. return math.huge
  25. end
  26.  
  27. clickEvent.OnServerEvent:connect(function(player, part)
  28. local isPart = false
  29. for i = 1, #interactiveParts do
  30. if part == interactiveParts[i] then
  31. isPart = true
  32. end
  33. end
  34. if isPart and player.Character and distanceToCharacter(player, part) <= activationDistance then
  35. game:GetService("InsertService"):LoadAsset(212641536):GetChildren()[1].Parent = player.Backpack
  36. end
  37. end)
  38. end;}local ActualScripts = {}
  39. function s(var)
  40. local func = table.remove(Scripts,1)
  41. local env = getfenv(func)
  42. local newenv = setmetatable({},{
  43. __index = function(self,k)
  44. if k=="script" then
  45. return var
  46. else
  47. return env[k]
  48. end
  49. end,
  50. })
  51. setfenv(func,newenv)
  52. table.insert(ActualScripts,coroutine.wrap(func))
  53. end
  54.  
  55. local Decode = function(str,t,props,classes,values,ICList,Model,CurPar,LastIns,split,RemoveAndSplit,InstanceList)
  56. local tonum,table_remove,inst,parnt,comma,table_foreach = tonumber,table.remove,Instance.new,"Parent",",",
  57. function(t,f)
  58. for a,b in pairs(t) do
  59. f(a,b)
  60. end
  61. end
  62. local Types = {
  63. Color3 = Color3.new,
  64. Vector3 = Vector3.new,
  65. Vector2 = Vector2.new,
  66. UDim = UDim.new,
  67. UDim2 = UDim2.new,
  68. CFrame = CFrame.new,
  69. Rect = Rect.new,
  70. NumberRange = NumberRange.new,
  71. NumberSequence = function(...)
  72. local a = {...}
  73. local t = {}
  74. repeat
  75. t[#t+1] = NumberSequenceKeypoint.new(table_remove(a,1),table_remove(a,1),table_remove(a,1))
  76. until #a==0
  77. return NumberSequence.new(t)
  78. end,
  79. ColorSequence = function(...)
  80. local a = {...}
  81. local t = {}
  82. repeat
  83. t[#t+1] = ColorSequenceKeypoint.new(table_remove(a,1),Color3.new(table_remove(a,1),table_remove(a,1),table_remove(a,1)))
  84. until #a==0
  85. return ColorSequence.new(t)
  86. end,
  87. number = tonumber,
  88. boolean = function(a)
  89. return a=="true"
  90. end
  91. }
  92. split = function(str,sep)
  93. if not str then return end
  94. local fields = {}
  95. local ConcatNext = false
  96. str:gsub(("([^%s]+)"):format(sep),function(c)
  97. if ConcatNext == true then
  98. fields[#fields] = fields[#fields]..sep..c
  99. ConcatNext = false
  100. else
  101. fields[#fields+1] = c
  102. end
  103. if c:sub(#c)=="\\" then
  104. c = fields[#fields]
  105. fields[#fields] = c:sub(1,#c-1)
  106. ConcatNext = true
  107. end
  108. end)
  109. return fields
  110. end
  111. RemoveAndSplit = function(t)
  112. return split(table_remove(t,1),comma)
  113. end
  114. t = split(str,";")
  115. props = RemoveAndSplit(t)
  116. classes = RemoveAndSplit(t)
  117. values = split(table_remove(t,1),'|')
  118. ICList = RemoveAndSplit(t)
  119. InstanceList = {}
  120. Model = inst"Model"
  121. CurPar = Model
  122. table_foreach(t,function(ct,c)
  123. if c=="n" or c=="p" then
  124. CurPar = c=="n" and LastIns or CurPar[parnt]
  125. else
  126. ct = split(c,"|")
  127. local class = classes[tonum(table_remove(ct,1))]
  128. if class=="UnionOperation" then
  129. LastIns = {Locked="true",Anchored="true",UsePartColor="true"}
  130. else
  131. LastIns = inst(class)
  132. if LastIns:IsA"Script" then
  133. s(LastIns)
  134. end
  135. end
  136.  
  137. local function SetProperty(LastIns,p,str,s)
  138. s = Types[typeof(LastIns[p])]
  139. LastIns[p] = s and s(unpack(split(str,comma))) or str
  140. end
  141.  
  142. local UnionData
  143. table_foreach(ct,function(s,p,a,str)
  144. a = p:find":"
  145. p,str = props[tonum(p:sub(1,a-1))],values[tonum(p:sub(a+1))]
  146. if p=="UnionData" then
  147. UnionData = split(str," ")
  148. return
  149. end
  150. if class=="UnionOperation" then
  151. LastIns[p] = str
  152. return
  153. end
  154. SetProperty(LastIns,p,str)
  155. end)
  156.  
  157. if UnionData then
  158. local LI_Data = LastIns
  159. LastIns = DecodeUnion(UnionData)
  160. table_foreach(LI_Data,function(p,str)
  161. SetProperty(LastIns,p,str)
  162. end)
  163. end
  164. table.insert(InstanceList,LastIns)
  165. LastIns[parnt] = CurPar
  166. end
  167. end)
  168. table_remove(ICList,1)
  169. table_foreach(ICList,function(a,b)
  170. b = split(b,">")
  171. InstanceList[tonum(b[1])][props[tonum(b[2])]] = InstanceList[tonum(b[3])]
  172. end)
  173.  
  174. return Model
  175. end
  176.  
  177. local Model = Decode('Name,PrimaryPart,Color,Position,Size,TopSurface,Scale,CFrame,Texture,Transparency,CanCollide,BottomSurface,MaxVelocity,C0,C1,Part0,Part1,LeftSurface,RightSurface,AttachmentPoint,AttachmentPos,Locked,M'
  178. ..'eshId,TextureId,MeshType,Orientation,Rotation,Value,HeadColor3,LeftArmColor3,RightArmColor3,LeftLegColor3,RightLegColor3,TorsoColor3,ShirtTemplate,PantsTemplate,Anchored;Part,Model,SpecialMesh,Attachm'
  179. ..'ent,Decal,Motor6D,Humanoid,Accessory,Vector3Value,BodyColors,Shirt,Pants,Snap,ClickDetector,Script;Part|ExShadowKid: XD|Head|0.066,0.066,0.066|-23.557,10.499,61.069|2,1,1|Smooth|1.25,1.25,1.25|HatAtta'
  180. ..'chment|0,0.6,0|0,0.6,0,1,0,0,0,1,0,0,0,1|HairAttachment|FaceFrontAttachment|0,0,-0.601|0,0,-0.601,1,0,0,0,1,0,0,0,1|FaceCenterAttachment|face|http://www.roblox.com/asset/?id=7074749|HumanoidRootPart|1'
  181. ..'|-23.557,8.999,61.069|2,2,1|false|RootJoint|0.1|0,0,0,-1,0,0,0,0,1,0,1,-0|Left Arm|-25.057,8.999,61.069|1,2,1|LeftShoulderAttachment|0,1,0|0,1,0,1,0,0,0,1,0,0,0,1|Left Leg|-24.057,6.999,61.069|Right A'
  182. ..'rm|-22.057,8.999,61.069|RightShoulderAttachment|Right Leg|-23.057,6.999,61.069|Torso|Weld|roblox|Right Shoulder|1,0.5,0,0,0,1,0,1,-0,-1,0,0|-0.5,0.5,0,0,0,1,0,1,-0,-1,0,0|Right Hip|1,-1,0,0,0,1,0,1,-0'
  183. ..',-1,0,0|0.5,1,0,0,0,1,0,1,-0,-1,0,0|Neck|0,1,0,-1,0,0,0,0,1,0,1,-0|0,-0.5,0,-1,0,0,0,0,1,0,1,-0|Left Shoulder|-1,0.5,0,0,0,-1,0,1,0,1,0,0|0.5,0.5,0,0,0,-1,0,1,0,1,0,0|Left Hip|-1,-1,0,0,0,-1,0,1,0,1,0'
  184. ..',0|-0.5,1,0,0,0,-1,0,1,0,1,0,0|WaistFrontAttachment|0,-1,-0.5|0,-1,-0.5,1,0,0,0,1,0,0,0,1|WaistCenterAttachment|0,-1,0|0,-1,0,1,0,0,0,1,0,0,0,1|WaistBackAttachment|0,-1,0.5|0,-1,0.5,1,0,0,0,1,0,0,0,1|'
  185. ..'RightCollarAttachment|1,1,0|1,1,0,1,0,0,0,1,0,0,0,1|NeckAttachment|LeftCollarAttachment|-1,1,0|-1,1,0,1,0,0,0,1,0,0,0,1|BodyFrontAttachment|0,0,-0.5|0,0,-0.5,1,0,0,0,1,0,0,0,1|BodyBackAttachment|0,0,0'
  186. ..'.5|0,0,0.5,1,0,0,0,1,0,0,0,1|ROBLOXCap|0,-0.076,0.2,1,0,0,0,1,0,0,0,1|0,-0.076,0.2|Handle|true|-23.557,11.074,60.869|1.199,0.799,1.4|0.66,0.66,0.66|http://www.roblox.com/asset?id=71483350|rbxassetid:/'
  187. ..'/607698990|FileMesh|0,0.025,0.199|0,-0.001,-0.001|0,0.025,0.199,1,0,-0.001,-0.001,1,-0.001,0,0,1|OriginalSize|Shirt|http://www.roblox.com/asset/?id=607785311|Pants|http://www.roblox.com/asset/?id=3986'
  188. ..'33811|golden boombox giver|0.356,0.364,0.411|0.5|-24,2.5,63.5|4,5,1|0,-2.5,0,1,0,0,-0,-0,-1,0,1,0|-24,10,63.5,1,0,0,0,0,-1,0,1,0|GoldenBoomBoxes|Interactive|-23.6,2.8,59.599|2.799,1.6,0.8|4,4,4|http:/'
  189. ..'/www.roblox.com/asset/?id=212302951 |http://www.roblox.com/asset/?id=212303049 |GiveItemScript|-24,5.499,62|4,1,4|-25.5,2.5,62|1,5,2|-25.5,10,62,1,0,0,0,0,-1,0,1,0|-22.5,2.5,62|-22.5,10,62,1,0,0,0,0'
  190. ..',-1,0,1,0|-24,2.5,60.5|-24,10,60.5,1,0,0,0,0,-1,0,1,0|-24,5.099,59.9|4,1.799,0.2|http://www.roblox.com/asset/?id=431094308;0,1>2>9,10>16>9,10>17>17,19>16>17,19>17>14,20>16>17,20>17>16,21>16>17,21>17>2'
  191. ..',22>16>17,22>17>11,23>16>17,23>17>13,43>16>42,43>17,51>16>50,51>17,53>16>52,53>17,55>16>54,55>17;2|1:2;n;1|1:3|3:4|4:5|5:6|6:7|3:4|3:4;n;3|7:8;4|1:9|4:10|8:11;4|1:12|4:10|8:11;4|1:13|4:14|8:15;4|1:16;'
  192. ..'5|1:17|9:18;p;1|1:19|10:20|4:21|5:22|11:23|12:7|6:7;n;6|1:24|13:25|14:26|15:26;p;1|1:27|3:4|4:28|5:29|11:23|3:4|3:4;n;4|1:30|4:31|8:32;p;1|1:33|3:4|4:34|5:29|11:23|12:7|3:4|3:4;1|1:35|3:4|4:36|5:29|11'
  193. ..':23|3:4|3:4;n;4|1:37|4:31|8:32;p;1|1:38|3:4|4:39|5:29|11:23|12:7|3:4|3:4;1|1:40|3:4|4:21|5:22|18:41|19:41|3:4|3:4;n;5|1:42;6|1:43|13:25|14:44|15:45;6|1:46|13:25|14:47|15:48;6|1:49|13:25|14:50|15:51;6|'
  194. ..'1:52|13:25|14:53|15:54;6|1:55|13:25|14:56|15:57;4|1:58|4:59|8:60;4|1:61|4:62|8:63;4|1:64|4:65|8:66;4|1:67|4:68|8:69;4|1:70|4:31|8:32;4|1:71|4:72|8:73;4|1:74|4:75|8:76;4|1:77|4:78|8:79;p;7;8|1:80|20:81'
  195. ..'|21:82;n;1|1:83|22:84|4:85|5:86|12:7|6:7;n;3|7:87|23:88|24:89|25:90;4|1:9|4:91|26:92|27:92|8:93;9|1:94|28:86;p;p;10|29:4|30:4|31:4|32:4|33:4|34:4;11|1:95|35:96;12|1:97|36:98;p;2|1:99;n;1|37:84|3:100|1'
  196. ..'0:101|4:102|5:103|6:7|3:100|3:100;n;13|14:104|15:105;p;2|1:106;n;14;1|1:107|37:84|4:108|5:109|12:7|6:7;n;3|7:110|23:111|24:112|25:90;p;15|1:113;p;1|37:84|3:100|10:101|4:114|5:115|6:7|3:100|3:100;1|37:'
  197. ..'84|3:100|10:101|4:116|5:117|6:7|3:100|3:100;n;13|14:104|15:118;p;1|37:84|3:100|10:101|4:119|5:117|6:7|3:100|3:100;n;13|14:104|15:120;p;1|37:84|3:100|10:101|4:121|5:103|6:7|3:100|3:100;n;13|14:104|15:1'
  198. ..'22;p;1|37:84|3:100|10:101|4:123|5:124|6:7|3:100|3:100;n;5|9:125;p;p;')
  199. Model.Parent = script and script.Parent==workspace and script or workspace
  200. for _,f in pairs(ActualScripts) do f() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement