Advertisement
HenloMyDude

terrain maker

Nov 24th, 2019
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.29 KB | None | 0 0
  1.  
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  4. local RealPlayer = Player
  5. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  6.  
  7. plr = owner
  8. plrgui = plr.PlayerGui
  9.  
  10. local gui = Instance.new("ScreenGui",plrgui)
  11. gui.Name = "TerrainMakerGui"
  12. gui.Enabled = true
  13.  
  14. local scroll = Instance.new("ScrollingFrame",gui)
  15. scroll.Size = UDim2.new(0, 440, 0, 500)
  16. scroll.Name = "Scroll"
  17.  
  18. local remote1 = Instance.new("RemoteEvent",scroll)
  19. remote1.Name = "SeaRemote"
  20.  
  21. function createtext(text, position, name)
  22. local thing = Instance.new("TextLabel",scroll)
  23. thing.Text = text
  24. thing.Name = name
  25. thing.TextScaled = true
  26. thing.Position = position
  27. thing.BackgroundTransparency = 0
  28. thing.BorderSizePixel = 1
  29. thing.BorderMode = "Outline"
  30. thing.Size = UDim2.new(0, 200, 0, 50)
  31. return thing
  32. end
  33.  
  34. function createbutton(text, position, name)
  35. local thing = Instance.new("TextButton",scroll)
  36. thing.Text = text
  37. thing.Name = name
  38. thing.TextScaled = true
  39. thing.Position = position
  40. thing.BackgroundTransparency = 0
  41. thing.BorderSizePixel = 1
  42. thing.BorderMode = "Outline"
  43. thing.Size = UDim2.new(0, 200, 0, 50)
  44. return thing
  45. end
  46.  
  47. function createbox(text, position, name)
  48. local thing = Instance.new("TextBox",scroll)
  49. thing.Text = text
  50. thing.Name = name
  51. thing.TextScaled = true
  52. thing.Position = position
  53. thing.BackgroundTransparency = 0
  54. thing.BorderSizePixel = 1
  55. thing.BorderMode = "Outline"
  56. thing.Size = UDim2.new(0, 200, 0, 50)
  57. return thing
  58. end
  59.  
  60. last = "a"
  61.  
  62. local seal = createbox("Sea Level", UDim2.new(0, 0, 0, 0), "SeaLevel")
  63. last = seal
  64. local applyl = createbutton("Apply", last.Position + UDim2.new(0.45, 0, 0, 0), "ApplySeaLevel")
  65. last = applyl
  66.  
  67. NLS([[
  68.  
  69. plr = owner
  70. plrgui = plr.PlayerGui
  71. gui = plrgui.TerrainMakerGui
  72. scroll = gui.Scroll
  73. seal = scroll.SeaLevel
  74. applyl = scroll.ApplySeaLevel
  75. remote1 = scroll.SeaRemote
  76.  
  77. applyl.MouseButton1Click:connect(function()
  78. remote1:FireServer(applyl.Text)
  79. end)
  80. ]],plr.Character)
  81.  
  82. function sealocal(player, texto)
  83. local y = texto
  84. local poot = Instance.new("Part",workspace)
  85. poot.Transparency = 1
  86. poot.Position = Vector3.new(0, -y, 0)
  87. poot.Size = Vector3.new(700.091187, y, 700.175964)
  88. poot.CanCollide = false
  89. poot.Anchored = true
  90. workspace.Terrain:FillBlock(poot.CFrame, poot.Size, Enum.Material.Water)
  91. poot:remove()
  92. end
  93.  
  94. remote1.OnServerEvent:connect(sealocal)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement