HansCSia320

Build a Boat for Treasure Spawn anything

May 19th, 2019
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.63 KB | None | 0 0
  1. local Plr = game:GetService("Players").LocalPlayer
  2. local Mouse = Plr:GetMouse()
  3. local Block = ""
  4. local iBlock = nil
  5. local ED = true
  6. local CON = Color3.new(0.0588235, 0.203922, 0.0509804)
  7. local COFF = Color3.new(0.203922, 0.0588235, 0.0588235)
  8. local BuildABoatForTreasure = Instance.new("ScreenGui")
  9. local BTN = Instance.new("TextButton")
  10.  
  11. local function RV()
  12. local res = ""
  13. for i = 1, 20 do
  14. res = res .. string.char(math.random(97, 122))
  15. end
  16. return res
  17. end
  18.  
  19. BuildABoatForTreasure.Name = RV()
  20. BuildABoatForTreasure.Parent = game.CoreGui
  21. BuildABoatForTreasure.ResetOnSpawn = false
  22.  
  23. BTN.Name = RV()
  24. BTN.Parent = BuildABoatForTreasure
  25. BTN.BackgroundColor3 = CON
  26. BTN.BackgroundTransparency = 0.30000001192093
  27. BTN.BorderColor3 = Color3.new(0.113725, 0.113725, 0.113725)
  28. BTN.BorderSizePixel = 2
  29. BTN.Position = UDim2.new(0, 0, 0.819734335, 0)
  30. BTN.Size = UDim2.new(0, 73, 0, 19)
  31. BTN.Font = Enum.Font.Code
  32. BTN.Text = " ENABLED"
  33. BTN.TextColor3 = Color3.new(1, 1, 1)
  34. BTN.TextSize = 16
  35. BTN.TextXAlignment = Enum.TextXAlignment.Left
  36.  
  37. BTN.MouseButton1Down:Connect(function()
  38. if ED then
  39. ED = false
  40. BTN.BackgroundColor3 = COFF
  41.     BTN.Text = " DISABLED"
  42. BTN.Size = UDim2.new(0, 80, 0, 19)
  43. else
  44. ED = true
  45. BTN.BackgroundColor3 = CON
  46.     BTN.Text = " ENABLED"
  47. BTN.Size = UDim2.new(0, 73, 0, 19)
  48. end
  49. end)
  50.  
  51. local function refresh()
  52. while wait(2)do
  53. if ED then
  54. for i,v in pairs(game.Workspace:GetChildren())do
  55. if v:FindFirstChild("Tag") then
  56. if v:FindFirstChild("Tag").Value == "" then
  57. iBlock = v
  58. end
  59. end
  60. end
  61. for i,b in pairs(game.Players.LocalPlayer.PlayerGui.BuildGui.ScrollingFrame.BlocksFrame:GetChildren())do
  62. if b.Name == "Selected" or b.Name == "UIGridLayout" or b.Name == "GamePadSelectLocalScript" then else
  63. b.Visible = true
  64. end
  65. end
  66. end
  67. end
  68. end
  69.  
  70. local function GetNum()
  71. return game.Players.LocalPlayer.PlayerGui.BuildGui.ScrollingFrame.BlocksFrame[Block].Amount.Value
  72. end
  73.  
  74. local this = Instance.new("Model", game.Workspace)
  75. this.Name = RV()
  76. local this2 = Instance.new("Part", this)
  77. this2.Name = "PPart"
  78.  
  79. Mouse.Button1Down:connect(function()
  80. if game.Workspace[Plr.Name]:FindFirstChild("BuildingTool")and ED then
  81. Block = game.Players.LocalPlayer.PlayerGui.BuildGui.ScrollingFrame.BlocksFrame.Selected.Value
  82. game.Workspace[Plr.Name]:FindFirstChild("BuildingTool").RF:InvokeServer(unpack({Block, GetNum(), this.PPart, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), 3, true, 17, iBlock:GetModelCFrame()}))
  83. end
  84. end)
  85.  
  86. Plr:GetMouse().KeyDown:connect(function(key)
  87. if key == 'q' and ED then
  88. if Mouse.Target then
  89. Plr.Character.HumanoidRootPart.CFrame = CFrame.new(Mouse.Hit.x, Mouse.Hit.y + 5, Mouse.Hit.z)
  90. end
  91. end
  92. end)
  93. refresh()
Add Comment
Please, Sign In to add comment