Advertisement
RobloxGUI_Working

Item Spawner rocistens

Jan 16th, 2021
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.55 KB | None | 0 0
  1.  
  2. local name = game:GetService("Players").LocalPlayer.Name
  3. local gui = game:GetService("CoreGui")
  4.  
  5. function showMsg(text)
  6. spawn(function()
  7. local msgwindow = Instance.new("ScreenGui")
  8. msgwindow.Name = "MsgWindow"
  9. msgwindow.Parent = gui
  10. local msgLabel = Instance.new("TextLabel")
  11. msgLabel.Text = text
  12. msgLabel.TextWrapped = true
  13. msgLabel.Parent = msgwindow
  14. msgLabel.Name = "msgLabel"
  15. msgLabel.Position = UDim2.new(0,-500,0,200)
  16. msgLabel.TextSize = 40
  17. msgLabel.Font = Enum.Font.Highway
  18. msgLabel.Size = UDim2.new(0, 505, 0, 500)
  19. msgLabel.BackgroundTransparency = 1
  20. msgLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  21. msgLabel.TextStrokeColor3 = Color3.fromRGB(math.random(255),math.random(255),math.random(255))
  22. msgLabel.TextStrokeTransparency = 0
  23. swoosh:Play()
  24. msgLabel:TweenPosition(UDim2.new(0,700,0,200))
  25. wait(5)
  26. swoosh2:Play()
  27. msgwindow:Remove()
  28. end)
  29. end
  30.  
  31. function findHouse(name)
  32. local yourHouse
  33. local things = workspace:GetChildren()
  34. for i = 1, #things do
  35. if things[i].Name == "Property" then
  36. local aHouse = things[i]:GetChildren()
  37. if aHouse[1].Name ~= "PlaceHolder" then
  38. local owner = aHouse[1].Owner.Value
  39. if owner == name then
  40. yourHouse = aHouse[1]
  41. end
  42. end
  43. end
  44. end
  45. if yourHouse == nil then
  46. apts = workspace.Apartments:GetChildren()
  47. for _,v in pairs(apts) do
  48. local owner = v.Owner.Value
  49. if owner == name then
  50. yourHouse = v
  51. end
  52. end
  53. end
  54. if yourHouse == nil then
  55. showMsg("No house found")
  56. end
  57. return yourHouse
  58. end
  59. function ISUpdate2(ItemSpawnerSF, gg, txt)
  60. yourHouse = findHouse(name)
  61. local i2 = 0
  62. for i = 1,#gg do
  63. if string.find(string.lower(gg[i].Name), string.lower(txt)) then
  64. if gg[i].Sort.Rooms.Value == "Unlisted" then
  65. local gg2 = gg[i].ColorOptions:GetChildren()
  66. for x = 1, #gg2 do
  67. i2 = i2 + 1
  68. local B = Instance.new("TextButton")
  69. local V = Instance.new("StringValue", B)
  70. V.Value = gg[i].Name
  71. local C = Instance.new("StringValue", B)
  72. C.Value = gg2[x].Name
  73. B.Parent = ItemSpawnerSF
  74. B.BackgroundColor3 = Color3.new(0.831373, 0.576471, 0.0627451)
  75. B.BorderSizePixel = 0
  76. B.Position = UDim2.new(0, 8, 0, (((i2-1)*22)+(3*i2)))
  77. B.Size = UDim2.new(0, 164, 0, 23)
  78. B.Font = Enum.Font.SourceSans
  79. B.Text = V.Value.." ("..C.Value..")"
  80. B.TextColor3 = Color3.new(0, 0, 0)
  81. B.TextScaled = true
  82. B.TextSize = 20
  83. B.TextWrapped = true
  84. ItemSpawnerSF.CanvasSize = UDim2.new(0,0,0,(#gg*22+(i*3)+3))
  85. B.MouseButton1Down:connect(function()
  86. press2:Play()
  87. local thing = game.ReplicatedStorage.Furniture:FindFirstChild(B.Text)
  88. local num = math.random(15)
  89. if num == 5 then
  90. showMsg("Tip: You must be standing in your house for this to work")
  91. end
  92. local tbl =
  93. {
  94. ["Id"] = "{B5G070FF-OMFG-4B87-B2C1-0A90ECC9C78F}",
  95. ["Name"] = V.Value,
  96. ["Color"] = C.Value
  97. }
  98. local cf = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").CFrame:toObjectSpace(yourHouse.PlaceHolder.Base.CFrame) + Vector3.new(game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").CFrame.lookVector)
  99. local x1, y1, z1, m11, m12, m13, m21, m22, m23, m31, m32, m33 = cf:components()
  100.  
  101. local tbl2 = {x1, y1, z1, m11, m12, m13, m21, m22, m23, m31, m32, m33}
  102. game:GetService("Workspace").CommunicationRelays.House.PlaceFurniture:InvokeServer(tbl, tbl2)
  103.  
  104. end)
  105. end
  106. end
  107. end
  108. end
  109. end
  110.  
  111. function ISUpdate(ItemSpawnerSF, gg)
  112. local i2 = 0
  113. yourHouse = findHouse(name)
  114. for i = 1,#gg do
  115. if gg[i].Sort.Rooms.Value == "Unlisted" then
  116. local gg2 = gg[i].ColorOptions:GetChildren()
  117. for x = 1, #gg2 do
  118. i2 = i2 + 1
  119. local B = Instance.new("TextButton")
  120. local V = Instance.new("StringValue", B)
  121. V.Value = gg[i].Name
  122. local C = Instance.new("StringValue", B)
  123. C.Value = gg2[x].Name
  124. B.Parent = ItemSpawnerSF
  125. B.BackgroundColor3 = Color3.new(0.831373, 0.576471, 0.0627451)
  126. B.BorderSizePixel = 0
  127. B.Position = UDim2.new(0, 8, 0, (((i2-1)*22)+(3*i2)))
  128. B.Size = UDim2.new(0, 164, 0, 23)
  129. B.Font = Enum.Font.SourceSans
  130. B.Text = V.Value.." ("..C.Value..")"
  131. B.TextColor3 = Color3.new(0, 0, 0)
  132. B.TextScaled = true
  133. B.TextSize = 20
  134. B.TextWrapped = true
  135.  
  136. ItemSpawnerSF.CanvasSize = UDim2.new(0,0,0,(#gg*22+(i2*3)+3))
  137.  
  138. B.MouseButton1Down:connect(function()
  139.  
  140. local thing = game.ReplicatedStorage.Furniture:FindFirstChild(B.Text)
  141. local num = math.random(15)
  142. if num == 5 then
  143. showMsg("Tip: You must be standing in your house for this to work")
  144. end
  145. local tbl =
  146. {
  147. ["Id"] = "{B5G070FF-OMFG-4B87-B2C1-0A90ECC9C78F}",
  148. ["Name"] = V.Value,
  149. ["Color"] = C.Value
  150. }
  151.  
  152. local cf = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").CFrame:toObjectSpace(yourHouse.Base.CFrame) + Vector3.new(game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").CFrame.lookVector)
  153. local x1, y1, z1, m11, m12, m13, m21, m22, m23, m31, m32, m33 = cf:components()
  154.  
  155. local tbl2 = {x1, y1, z1, m11, m12, m13, m21, m22, m23, m31, m32, m33}
  156. game:GetService("Workspace").CommunicationRelays.House.PlaceFurniture:InvokeServer(tbl, tbl2)
  157. end)
  158. end
  159. end
  160. end
  161. end
  162.  
  163. local LogansSpawner= Instance.new("ScreenGui")
  164. LogansSpawner.Name = "LogansSpawner"
  165. LogansSpawner.Parent = gui
  166. LogansSpawner.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  167.  
  168.  
  169. local ISSearchBox = Instance.new("TextBox")
  170. local ItemSpawnerSF = Instance.new("ScrollingFrame")
  171. local ItemSpawnerF = Instance.new("Frame")
  172.  
  173. ItemSpawnerF.Name = "ItemSpawnerF"
  174. ItemSpawnerF.Parent = LogansSpawner
  175. ItemSpawnerF.BackgroundColor3 = Color3.new(0.0705882, 0.0705882, 0.0705882)
  176. ItemSpawnerF.BorderSizePixel = 0
  177. ItemSpawnerF.Position = UDim2.new(0.5, 135, 0.5, -174)
  178. ItemSpawnerF.Size = UDim2.new(0, 194, 0, 348)
  179. ItemSpawnerF.Visible = true
  180. ItemSpawnerF.Active = true
  181. ItemSpawnerF.Draggable = true
  182.  
  183.  
  184. TitleItem = Instance.new("TextLabel")
  185. TitleItem.Name = "TitleItem"
  186. TitleItem.Parent = ItemSpawnerF
  187. TitleItem.BackgroundColor3 = Color3.new(0.831373, 0.286275, 0.121569)
  188. TitleItem.BorderSizePixel = 0
  189. TitleItem.Size = UDim2.new(0, 194, 0, 30)
  190. TitleItem.Font = Enum.Font.Arial
  191. TitleItem.Text = "LoganRMX's Limiteds"
  192. TitleItem.TextColor3 = Color3.new(0, 0, 0)
  193. TitleItem.TextSize = 16
  194. TitleItem.TextWrapped = true
  195.  
  196. ItemSpawnerSF.Name = "ItemSpawnerSF"
  197. ItemSpawnerSF.Parent = ItemSpawnerF
  198. ItemSpawnerSF.BackgroundColor3 = Color3.new(0.0705882, 0.0705882, 0.0705882)
  199. ItemSpawnerSF.BorderSizePixel = 0
  200. ItemSpawnerSF.Position = UDim2.new(0, 0, 0.203448279, 0)
  201. ItemSpawnerSF.Size = UDim2.new(0, 194, 0, 318)
  202.  
  203. ISSearchBox.Name = "ISSearchBox"
  204. ISSearchBox.Parent = ItemSpawnerF
  205. ISSearchBox.BackgroundColor3 = Color3.new(1, 1, 1)
  206. ISSearchBox.BackgroundTransparency = 0.80000001192093
  207. ISSearchBox.Size = UDim2.new(0, 194, 0, 29)
  208. ISSearchBox.Font = Enum.Font.SourceSans
  209. ISSearchBox.PlaceholderText = "Search Item..."
  210. ISSearchBox.Text = ""
  211. ISSearchBox.TextColor3 = Color3.new(1, 1, 1)
  212. ISSearchBox.TextSize = 18
  213. ISSearchBox.Position = UDim2.new(0, 0, 0.103448279, 0)
  214. local gg = game.ReplicatedStorage.Furniture:GetChildren()
  215. ISUpdate(ItemSpawnerSF, gg)
  216. spawn(function()
  217. while wait() do
  218.  
  219. local TweenService = game:GetService("TweenService")
  220. local tween = TweenService:Create(TitleItem,
  221. TweenInfo.new(1, Enum.EasingStyle["Linear"].Value, Enum.EasingDirection["Out"].Value),
  222. {BackgroundColor3 = Color3.fromRGB(math.random(255),math.random(255),math.random(255))})
  223. tween:Play()
  224. tween.Completed:Wait()
  225. tween:Destroy()
  226.  
  227. end
  228. end)
  229. ISSearchBox.FocusLost:Connect(function()
  230. local yourHouse = findHouse(name)
  231. if yourHouse ~= nil then
  232. local txt = ISSearchBox.Text
  233. local items = ItemSpawnerSF:GetChildren()
  234. if txt ~= "" then
  235. for i=1, #items do
  236. items[i]:Destroy()
  237. end
  238. local gg = game.ReplicatedStorage.Furniture:GetChildren()
  239. ISUpdate2(ItemSpawnerSF, gg, txt)
  240.  
  241.  
  242. else
  243. local gg = game.ReplicatedStorage.Furniture:GetChildren()
  244. ISUpdate(ItemSpawnerSF, gg)
  245.  
  246.  
  247.  
  248. end
  249. end
  250. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement