Advertisement
Guest User

Local Player Gui

a guest
Oct 14th, 2019
832
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.24 KB | None | 0 0
  1. --Gui Instances
  2.  
  3. wait(0.3)
  4. sg = Instance.new("ScreenGui",game.Players.LocalPlayer.PlayerGui)
  5. sg.Name = ("main")
  6.  
  7. tab = Instance.new("Frame",sg)
  8. tab.Name = ("tab")
  9.  
  10. credits = Instance.new("TextLabel",tab)
  11. credits.Name = ("credits")
  12.  
  13. xout = Instance.new("TextButton",tab)
  14. xout.Name = ("xout")
  15.  
  16. frame = Instance.new("Frame",tab)
  17. frame.Name = ("frame")
  18.  
  19. jump = Instance.new("TextButton",frame)
  20. jump.Name = ("jump")
  21.  
  22. value = Instance.new("TextBox",frame)
  23. value.Name = ("value")
  24.  
  25. help = Instance.new("TextLabel",frame)
  26. help.Name = ("help")
  27.  
  28. speed = Instance.new("TextButton",frame)
  29. speed.Name = ("speedbutton")
  30.  
  31. reset = Instance.new("TextButton",frame)
  32. reset.Name = ("reset")
  33.  
  34. nofog = Instance.new("TextButton",frame )
  35. nofog.Name = ("nofog")
  36.  
  37. bright = Instance.new("TextButton",frame)
  38. bright.Name = ("bright")
  39.  
  40. noclip = Instance.new("TextButton",frame)
  41. noclip.Name = ("noclip")
  42.  
  43. fly = Instance.new("TextButton",frame)
  44. fly.Name = ("fly")
  45.  
  46. flyr = Instance.new("TextButton",frame)
  47. flyr.Name = ("flyr")
  48.  
  49. --Gui Appearance
  50. tab.Size = UDim2.new(0,465,0,30)
  51. tab.Position = UDim2.new(0.3,0,0.3,0)
  52. tab.Active = true
  53. tab.Draggable = true
  54. tab.BorderSizePixel = 0
  55. tab.BackgroundColor3 = Color3.new(0.25,0.25,0.25)
  56. tab.BackgroundTransparency = 0
  57.  
  58. credits.Size = UDim2.new(0,265,0,30)
  59. credits.Position = UDim2.new(0,0,0.1,0)
  60. credits.BorderSizePixel = 0
  61. credits.Text = ("Local Gui by imgoodatroblock")
  62. credits.BackgroundTransparency = 1
  63. credits.TextColor3 = Color3.new(1,1,1)
  64. credits.TextSize = 14
  65.  
  66. xout.Size = UDim2.new(0,75,0,25)
  67. xout.Position = UDim2.new(0.83,0,0.1,0)
  68. xout.BorderSizePixel = 0
  69. xout.Text = ("Destroy Gui")
  70. xout.BackgroundColor3 = Color3.new(1,0,0)
  71. xout.TextColor3 = Color3.new(0,0,0)
  72. xout.Font = ("SciFi")
  73. xout.TextSize = ("14")
  74.  
  75. frame.Size = UDim2.new(0,465,0,300)
  76. frame.Position = UDim2.new(0,0,1,0)
  77. frame.BorderSizePixel = 0
  78. frame.BackgroundColor3 = Color3.new(0.15,0.15,0.15)
  79.  
  80. value.Size = UDim2.new(0,100,0,30)
  81. value.Position = UDim2.new(0,10,0,10)
  82. value.BackgroundColor3 = Color3.new(0.50,0.50,0.50)
  83. value.BorderSizePixel = 0
  84. value.Text = ("Value")
  85. value.TextColor3 = Color3.new(0,0,0)
  86. value.TextScaled = true
  87. value.Font = ("Arial")
  88. value.BackgroundTransparency = 0
  89.  
  90. help.Position = UDim2.new(0,250,0,285)
  91. help.Text = ("Press p to open and close the gui")
  92. help.TextColor3 = Color3.new(1,1,1)
  93. help.TextSize = 15
  94. help.Font = ("Arial")
  95.  
  96. speed.Size = UDim2.new(0,95,0,50)
  97. speed.Position = UDim2.new(0,10,0,50)
  98. speed.BackgroundColor3 = Color3.new(127,0,0)
  99. speed.Style = Enum.ButtonStyle.RobloxRoundButton
  100. speed.BorderSizePixel = 0
  101. speed.Text = ("Set Walkspeed")
  102. speed.TextColor3 = Color3.new(0,0,0)
  103. speed.TextScaled = true
  104. speed.Font = ("Arial")
  105. speed.BackgroundTransparency = 0.5
  106.  
  107. jump.Size = UDim2.new(0,95,0,50)
  108. jump.Position = UDim2.new(0,10,0,100)
  109. jump.BackgroundColor3 = Color3.new(127,0,0)
  110. jump.Style = Enum.ButtonStyle.RobloxRoundButton
  111. jump.BorderSizePixel = 0
  112. jump.Text = ("Set Jump Power")
  113. jump.TextColor3 = Color3.new(0,0,0)
  114. jump.TextScaled = true
  115. jump.Font = ("Arial")
  116.  
  117. reset.Size = UDim2.new(0,95,0,50)
  118. reset.Position = UDim2.new(0,10,0,150)
  119. reset.BackgroundColor3 = Color3.new(127,0,0)
  120. reset.Style = Enum.ButtonStyle.RobloxRoundButton
  121. reset.BorderSizePixel = 0
  122. reset.Text = ("Reset Jump and Speed")
  123. reset.TextColor3 = Color3.new(0,0,0)
  124. reset.TextScaled = true
  125. reset.Font = ("Arial")
  126.  
  127. nofog.Size = UDim2.new(0,95,0,50)
  128. nofog.Position = UDim2.new(0,10,0,200)
  129. nofog.BackgroundColor3 = Color3.new(127,0,0)
  130. nofog.Style = Enum.ButtonStyle.RobloxRoundButton
  131. nofog.BorderSizePixel = 0
  132. nofog.Text = ("Remove Fog")
  133. nofog.TextColor3 = Color3.new(0,0,0)
  134. nofog.TextScaled = true
  135. nofog.Font = ("Arial")
  136.  
  137. bright.Size = UDim2.new(0,95,0,50)
  138. bright.Position = UDim2.new(0,110,0,50)
  139. bright.BackgroundColor3 = Color3.new(127,0,0)
  140. bright.Style = Enum.ButtonStyle.RobloxRoundButton
  141. bright.BorderSizePixel = 0
  142. bright.Text = ("FullBright")
  143. bright.TextColor3 = Color3.new(0,0,0)
  144. bright.TextScaled = true
  145. bright.Font = ("Arial")
  146. bright.BackgroundTransparency = 0.5
  147.  
  148. noclip.Size = UDim2.new(0,95,0,50)
  149. noclip.Position = UDim2.new(0,110,0,100)
  150. noclip.BackgroundColor3 = Color3.new(127,0,0)
  151. noclip.Style = Enum.ButtonStyle.RobloxRoundButton
  152. noclip.BorderSizePixel = 0
  153. noclip.Text = ("Noclip")
  154. noclip.TextColor3 = Color3.new(0,0,0)
  155. noclip.TextScaled = true
  156. noclip.Font = ("Arial")
  157. noclip.BackgroundTransparency = 0.5
  158.  
  159. fly.Size = UDim2.new(0,95,0,50)
  160. fly.Position = UDim2.new(0,110,0,150)
  161. fly.BackgroundColor3 = Color3.new(127,0,0)
  162. fly.Style = Enum.ButtonStyle.RobloxRoundButton
  163. fly.BorderSizePixel = 0
  164. fly.Text = ("Get Fly Tool")
  165. fly.TextColor3 = Color3.new(0,0,0)
  166. fly.TextScaled = true
  167. fly.Font = ("Arial")
  168. fly.BackgroundTransparency = 0.5
  169.  
  170. flyr.Size = UDim2.new(0,95,0,50)
  171. flyr.Position = UDim2.new(0,110,0,200)
  172. flyr.BackgroundColor3 = Color3.new(127,0,0)
  173. flyr.Style = Enum.ButtonStyle.RobloxRoundButton
  174. flyr.BorderSizePixel = 0
  175. flyr.Text = ("Remove Fly Tool")
  176. flyr.TextColor3 = Color3.new(0,0,0)
  177. flyr.TextScaled = true
  178. flyr.Font = ("Arial")
  179. flyr.BackgroundTransparency = 0.5
  180.  
  181. --Button Actions
  182.  
  183. sg.ResetOnSpawn = false
  184.  
  185. xout.MouseButton1Click:connect(function()
  186.     sg:Remove()
  187. end)
  188.  
  189. speed.MouseButton1Click:connect(function()
  190.     game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = value.Text
  191. end)
  192.  
  193. jump.MouseButton1Click:connect(function()
  194.     game.Players.LocalPlayer.Character.Humanoid.JumpPower = value.Text
  195. end)
  196.  
  197. reset.MouseButton1Click:connect(function()
  198.     game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
  199.     game.Players.LocalPlayer.Character.Humanoid.JumpPower = 50
  200. end)
  201.  
  202. nofog.MouseButton1Click:connect(function()
  203.     game.Lighting.FogEnd = 100000
  204.     game.Lighting.FogStart = 100000
  205. end)
  206.  
  207. bright.MouseButton1Click:connect(function()
  208.     game.Lighting.Brightness = 10
  209. end)
  210.  
  211. noclip.MouseButton1Click:connect(function()
  212.     local noclip = true char = game.Players.LocalPlayer.Character while true do if noclip == true then for _,v in pairs(char:children()) do pcall(function() if v.className == "Part" then v.CanCollide = false elseif v.ClassName == "Model" then v.Head.CanCollide = false end end) end end game:service("RunService").Stepped:wait() end
  213. end)
  214.  
  215. fly.MouseButton1Click:connect(function()
  216.     wait();
  217.  
  218. local MaxFlySpeed = 2
  219.  
  220. local UIS = game:GetService("UserInputService")
  221. local LocalPlayer = game:GetService("Players").LocalPlayer
  222. local Torso = (LocalPlayer.Character and LocalPlayer.Character:WaitForChild("Torso"))
  223. local Mouse = LocalPlayer:GetMouse()
  224. local Tool = Instance.new("Tool")
  225. Tool.RequiresHandle = false
  226. Tool.Name = "Fly_tool"
  227.  
  228. assert(Torso.ClassName == "Part", "Yikes! Torso is not a part.")
  229.  
  230. local ToolUtils do
  231.     ToolUtils = {
  232.         --// Setup Vars
  233.         Enabled = false,
  234.         WindowFocused = true,
  235.  
  236.         Keys = {},        
  237.         InternalVars = {
  238.             FlyForward = 0,
  239.             FlyBackward = 0
  240.         }      
  241.     }
  242. end
  243.  
  244. local ToolEvents do
  245.     Tool.Equipped:connect(function(Mouse)
  246.         ToolUtils.Enabled = true
  247.         Torso.Anchored = true
  248.     end)
  249.     Tool.Unequipped:connect(function(...)
  250.         ToolUtils.Enabled = false
  251.         Torso.Anchored = false
  252.     end)
  253.     UIS.InputBegan:connect(function(input, processedEvent)
  254.         ToolUtils.Keys[input.KeyCode] = true
  255.     end)
  256.     UIS.InputEnded:connect(function(input, processedEvent)
  257.         ToolUtils.Keys[input.KeyCode] = nil
  258.     end)
  259.     UIS.WindowFocusReleased:connect(function()
  260.         ToolUtils.WindowFocused = false
  261.     end)
  262.     UIS.WindowFocused:connect(function()
  263.         ToolUtils.WindowFocused = true
  264.     end)
  265. end
  266.  
  267. --// Main Event
  268. game:GetService("RunService").RenderStepped:connect(function(...)
  269.     if ToolUtils.WindowFocused and ToolUtils.Enabled then
  270.         if ToolUtils.Keys[Enum.KeyCode.W] then
  271.             if ToolUtils.InternalVars.FlyForward < MaxFlySpeed then
  272.                 ToolUtils.InternalVars.FlyForward = ToolUtils.InternalVars.FlyForward + 0.1
  273.             end
  274.         else
  275.             ToolUtils.InternalVars.FlyForward = ToolUtils.InternalVars.FlyForward * 0.9
  276.         end
  277.         if ToolUtils.Keys[Enum.KeyCode.S] then
  278.             if ToolUtils.InternalVars.FlyBackward < MaxFlySpeed then
  279.                 ToolUtils.InternalVars.FlyBackward = ToolUtils.InternalVars.FlyBackward + 0.1
  280.             end
  281.         else
  282.             ToolUtils.InternalVars.FlyBackward = ToolUtils.InternalVars.FlyBackward * 0.9          
  283.         end
  284.        
  285.         local Camera = workspace.CurrentCamera
  286.         Torso.CFrame = Torso.CFrame:lerp(
  287.             CFrame.new(Torso.Position, Camera.CFrame.p)
  288.                * CFrame.Angles(0, math.rad(180), 0)
  289.                * CFrame.new(0, 0, -(ToolUtils.InternalVars.FlyForward - ToolUtils.InternalVars.FlyBackward))
  290.                * CFrame.Angles(-(math.rad(10 * (ToolUtils.InternalVars.FlyForward / MaxFlySpeed)) - math.rad(10 * (ToolUtils.InternalVars.FlyBackward / MaxFlySpeed))), 0, 0)
  291.         , 0.9)
  292.     end
  293. end)
  294.  
  295. Tool.Parent = LocalPlayer:findFirstChild("Backpack") or Instance.new("Backpack", LocalPlayer)
  296. end)
  297.  
  298. flyr.MouseButton1Click:connect(function()
  299.     game.Players.LocalPlayer.Backpack.Fly_tool:Remove()
  300. end)
  301.  
  302. --P
  303.  
  304. local Player = game.Players.LocalPlayer
  305. local Mouse = Player:GetMouse()
  306. local Open = true
  307.  
  308.  
  309. function PressP(key)
  310.     if (key == "p") then
  311.         if (Open == true) then
  312.             tab:TweenPosition(UDim2.new(2,0,2,0), 'Out', 'Bounce', 1, true)
  313.             Open = false
  314.         elseif (Open == false) then
  315.             tab:TweenPosition(UDim2.new(0.3,0,0.3,0), 'Out', 'Bounce', 1, true)
  316.             Open = true
  317.         end
  318.     end
  319. end
  320.  
  321. Mouse.KeyDown:connect(PressP)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement