Advertisement
Upscalefanatic3

Dead winter spawn GUI

Dec 23rd, 2017
1,755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.24 KB | None | 0 0
  1. --written by kent911t =D
  2.  
  3.  
  4. local SpawnGui = Instance.new("ScreenGui")
  5. local ItemName = Instance.new("TextBox")
  6. local TextButton = Instance.new("TextButton")
  7. local Count = Instance.new("TextBox")
  8. local TextButton_2 = Instance.new("TextButton")
  9. local Hide = Instance.new("TextButton")
  10. local Show = Instance.new("TextButton")
  11. local SpawnButton = Instance.new("TextButton")
  12.  
  13. -- Properties
  14.  
  15. SpawnGui.Name = "SpawnGui"
  16. SpawnGui.Parent = game.CoreGui
  17.  
  18. ItemName.Name = "ItemName"
  19. ItemName.Parent = SpawnGui
  20. ItemName.BackgroundColor3 = Color3.new(0.529412, 0.529412, 0.529412)
  21. ItemName.Position = UDim2.new(0, 0, 0, 300)
  22. ItemName.Size = UDim2.new(0, 200, 0, 50)
  23. ItemName.Font = Enum.Font.SciFi
  24. ItemName.FontSize = Enum.FontSize.Size14
  25. ItemName.Text = "Item"
  26.  
  27. TextButton.Parent = ItemName
  28. TextButton.BackgroundColor3 = Color3.new(1, 0, 0.0156863)
  29. TextButton.Position = UDim2.new(0, 200, 0, 0)
  30. TextButton.Size = UDim2.new(0, 50, 0, 50)
  31. TextButton.Font = Enum.Font.SciFi
  32. TextButton.FontSize = Enum.FontSize.Size10
  33. TextButton.Text = "Item OK!"
  34.  
  35. Count.Name = "Count"
  36. Count.Parent = SpawnGui
  37. Count.BackgroundColor3 = Color3.new(0.529412, 0.529412, 0.529412)
  38. Count.Position = UDim2.new(0, 0, 0, 350)
  39. Count.Size = UDim2.new(0, 200, 0, 50)
  40. Count.Font = Enum.Font.SciFi
  41. Count.FontSize = Enum.FontSize.Size14
  42. Count.Text = "Stack in item"
  43.  
  44. TextButton_2.Parent = Count
  45. TextButton_2.BackgroundColor3 = Color3.new(1, 0, 0.0156863)
  46. TextButton_2.Position = UDim2.new(0, 200, 0, 0)
  47. TextButton_2.Size = UDim2.new(0, 50, 0, 50)
  48. TextButton_2.Font = Enum.Font.SciFi
  49. TextButton_2.FontSize = Enum.FontSize.Size10
  50. TextButton_2.Text = "Stack OK!"
  51.  
  52. Hide.Name = "Hide"
  53. Hide.Parent = SpawnGui
  54. Hide.BackgroundColor3 = Color3.new(1, 1, 1)
  55. Hide.Position = UDim2.new(0, 0, 0, 264)
  56. Hide.Size = UDim2.new(0, 50, 0, 35)
  57. Hide.Font = Enum.Font.SciFi
  58. Hide.FontSize = Enum.FontSize.Size10
  59. Hide.Text = "Hide <"
  60.  
  61. Show.Name = "Show"
  62. Show.Parent = SpawnGui
  63. Show.BackgroundColor3 = Color3.new(1, 1, 1)
  64. Show.Position = UDim2.new(0, 0, 0, 264)
  65. Show.Size = UDim2.new(0, 50, 0, 35)
  66. Show.Visible = false
  67. Show.Font = Enum.Font.SciFi
  68. Show.FontSize = Enum.FontSize.Size10
  69. Show.Text = "Show >"
  70.  
  71. SpawnButton.Name = "SpawnButton"
  72. SpawnButton.Parent = SpawnGui
  73. SpawnButton.BackgroundColor3 = Color3.new(1, 0.666667, 0)
  74. SpawnButton.Position = UDim2.new(0, 0, 0, 451)
  75. SpawnButton.Size = UDim2.new(0, 250, 0, 40)
  76. SpawnButton.Font = Enum.Font.SciFi
  77. SpawnButton.FontSize = Enum.FontSize.Size10
  78. SpawnButton.Text = "Spawn!"
  79. SpawnButton.TextColor3 = Color3.new(0, 0, 0)
  80.  
  81. lightup = function(button)
  82. coroutine.resume(coroutine.create(function()
  83. local origincolor = button.BackgroundColor3
  84. button.BackgroundColor3 = Color3.new(0, 1, 0)
  85. wait(0.1)
  86. button.BackgroundColor3 = origincolor
  87. end))
  88. end
  89.  
  90. function changename()
  91. lightup(TextButton)
  92. nameofitem = ItemName.Text
  93. end
  94. TextButton.MouseButton1Down:connect(changename)
  95.  
  96. function changeamount()
  97. lightup(TextButton_2)
  98. Amount = tonumber(Count.Text)
  99. end
  100. TextButton_2.MouseButton1Down:connect(changeamount)
  101.  
  102. HideGui = function()
  103. lightup(Hide)
  104. for _, v in pairs (SpawnGui:GetChildren()) do
  105. v.Visible = false
  106. end
  107. Show.Visible = true
  108. end
  109. Hide.MouseButton1Down:connect(HideGui)
  110.  
  111. ShowGui = function()
  112. lightup(Show)
  113. for _, v in pairs (SpawnGui:GetChildren()) do
  114. v.Visible = true
  115. end
  116. Show.Visible = false
  117. end
  118. Show.MouseButton1Down:connect(ShowGui)
  119.  
  120. local player = game.Players.LocalPlayer
  121. local user = player.Character;
  122. local cam = workspace.CurrentCamera;
  123.  
  124. function spawnitem()
  125. lightup(SpawnButton)
  126. if Amount and nameofitem then
  127. for i = 1, Amount do
  128. local player = game.Players.LocalPlayer
  129. local user = player.Character;
  130. local cam = workspace.CurrentCamera;
  131. local hit, position = workspace:FindPartOnRayWithIgnoreList(Ray.new((user.Torso.CFrame*CFrame.new(0, 0, -5)).p, Vector3.new(0, -60, 0)), {cam, workspace.Terrain});
  132. local area = CFrame.new(position+Vector3.new(0, 3, 0))*CFrame.Angles(0, math.rad(math.random(0, 359)), 0);
  133. local origin = game.Players.LocalPlayer.Character.Torso.CFrame;
  134. local cframe = area*origin:toObjectSpace(game.Players.LocalPlayer.Character.Torso.CFrame);
  135. game.Workspace.resources.events.createItemInWorld:FireServer(10, tostring(nameofitem), cframe)
  136. end
  137. end
  138. end
  139.  
  140. SpawnButton.MouseButton1Down:connect(spawnitem)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement