RUDEAlex

Untitled

Jul 16th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. local Sea = Instance.new("Part")
  2. Sea.FormFactor = "Custom"
  3. Sea.BrickColor = BrickColor.new("Bright blue")
  4. Sea.Transparency = 0.4
  5. Sea.Reflectance = 0
  6. Sea.Size = Vector3.new(1, 1, 1)
  7. Sea.Anchored = true
  8. Sea.CanCollide = false
  9. Sea.Name = "Sea"
  10. local Mesh = Instance.new("SpecialMesh")
  11. Mesh.MeshType = "Brick"
  12. Mesh.Parent = Sea
  13. Sea.Parent = Workspace
  14. local tideWaver = 0
  15. local tideWaverMult = 50
  16. local tideLow = 100
  17. local tideHigh = 250
  18. local tidePosition = 0
  19. tide = math.random(tideLow, tideHigh)
  20. while true do
  21. if Sea == nil then break end
  22. if Sea.Parent == nil then break end
  23. if math.random(1, 500) == 1 then tide = math.random(tideLow, tideHigh) end
  24. if tidePosition < tide then
  25. tidePosition = tidePosition + 0.1
  26. elseif tidePosition > tide then
  27. tidePosition = tidePosition - 0.1
  28. else
  29. tidePosition = tide
  30. end
  31. tideWaver = tideWaver + 0.01
  32. Sea.CFrame = CFrame.new(0, (tidePosition / 2) + ((math.sin(tideWaver) * tideWaverMult) / 2), 0)
  33. Mesh.Scale = Vector3.new(10000, tidePosition + (math.sin(tideWaver) * tideWaverMult), 10000)
  34. for _, p in pairs(game:GetService("Players"):GetPlayers()) do
  35. if p.Character ~= nil then
  36. if p.Character:FindFirstChild("Head") ~= nil then
  37. local pg = p:FindFirstChild("PlayerGui")
  38. if pg == nil then pg = Instance.new("PlayerGui", p) end
  39. if p.Character.Head.Position.y < tidePosition + (math.sin(tideWaver) * tideWaverMult) then
  40. if pg:FindFirstChild("Sea") == nil then
  41. local s = Instance.new("ScreenGui")
  42. s.Name = "Sea"
  43. f = Instance.new("Frame")
  44. f.BackgroundTransparency = 1
  45. f.BackgroundColor3 = Color3.new(0, 0, 1)
  46. f.Size = UDim2.new(2, 0, 2, 0)
  47. f.Position = UDim2.new(-1, 0, -1, 0)
  48. f.Parent = s
  49. s.Parent = pg
  50. coroutine.resume(coroutine.create(function()
  51. local t = Sea.Transparency
  52. for x = 1, t, -0.05 do
  53. f.BackgroundTransparency = x
  54. wait()
  55. end
  56. f.BackgroundTransparency = t
  57. end))
  58. end
  59. else
  60. if pg:FindFirstChild("Sea") ~= nil then
  61. coroutine.resume(coroutine.create(function()
  62. local s = pg.Sea
  63. for x = s.Frame.BackgroundTransparency, 1, 0.05 do
  64. s.Frame.BackgroundTransparency = x
  65. wait()
  66. end
  67. s:Remove()
  68. end))
  69. end
  70. end
  71. end
  72. if p.Character:FindFirstChild("Torso") ~= nil then
  73. if p.Character.Torso.Position.y + 0.5 < tidePosition + (math.sin(tideWaver) * tideWaverMult) then
  74. p.Character.Torso.Velocity = p.Character.Torso.Velocity + Vector3.new(0, 7.5 * (function() local vel = (math.abs(p.Character.Torso.Velocity.y - tidePosition) / 30) if vel > 25 then return 25 else return vel end end)(), 0)
  75. end
  76. end
  77. end
  78. end
  79. wait()
  80. end
Add Comment
Please, Sign In to add comment