Advertisement
munciseek

Untitled

Aug 26th, 2024
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.71 KB | None | 0 0
  1. -- Gui to Lua
  2.  
  3.  
  4. -- Version: 3.2
  5.  
  6.  
  7.  
  8. -- Instances:
  9.  
  10.  
  11. local runService = game:GetService("RunService")
  12.  
  13.  
  14.  
  15. local character = game.Players.LocalPlayer.Character
  16.  
  17.  
  18. local humanoid = character:WaitForChild("Humanoid")
  19.  
  20.  
  21.  
  22. local StaminaBar = Instance.new("ScreenGui")
  23.  
  24.  
  25. local Border = Instance.new("Frame")
  26.  
  27.  
  28. local Bar = Instance.new("Frame")
  29.  
  30.  
  31. local SideBar = Instance.new("Frame")
  32.  
  33.  
  34. local Bar_2 = Instance.new("Frame")
  35.  
  36.  
  37.  
  38. --Properties:
  39.  
  40.  
  41.  
  42. StaminaBar.Name = "StaminaBar"
  43.  
  44.  
  45. StaminaBar.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  46.  
  47.  
  48. StaminaBar.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  49.  
  50.  
  51.  
  52. Border.Name = "Border"
  53.  
  54.  
  55. Border.Parent = StaminaBar
  56.  
  57.  
  58. Border.AnchorPoint = Vector2.new(0, 1)
  59.  
  60.  
  61. Border.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  62.  
  63.  
  64. Border.BorderColor3 = Color3.fromRGB(0, 0, 0)
  65.  
  66.  
  67. Border.BorderSizePixel = 4
  68.  
  69.  
  70. Border.Position = UDim2.new(0.25, 0, 0.85, 0)
  71.  
  72.  
  73. Border.Size = UDim2.new(0.6, 0, 0.0263093561, 0)
  74.  
  75.  
  76.  
  77. Bar.Name = "Bar"
  78.  
  79.  
  80. Bar.Parent = Border
  81.  
  82.  
  83. Bar.AnchorPoint = Vector2.new(0, 1)
  84.  
  85.  
  86. Bar.BackgroundColor3 = Color3.fromRGB(255, 255, 0)
  87.  
  88.  
  89. Bar.BorderColor3 = Color3.fromRGB(0, 0, 0)
  90.  
  91.  
  92. Bar.BorderSizePixel = 0
  93.  
  94.  
  95. Bar.Position = UDim2.new(0, 0, 1, 0)
  96.  
  97.  
  98. Bar.Size = UDim2.new(1, 0, 1, 0)
  99.  
  100.  
  101.  
  102. SideBar.Name = "SideBar"
  103.  
  104.  
  105. SideBar.Parent = StaminaBar
  106.  
  107.  
  108. SideBar.AnchorPoint = Vector2.new(0, 1)
  109.  
  110.  
  111. SideBar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  112.  
  113.  
  114. SideBar.BorderColor3 = Color3.fromRGB(0, 0, 0)
  115.  
  116.  
  117. SideBar.BorderSizePixel = 4
  118.  
  119.  
  120. SideBar.Position = UDim2.new(0.985890269, 0, 1, 0)
  121.  
  122.  
  123. SideBar.Size = UDim2.new(0.0141097549, 0, 0.17468825, 0)
  124.  
  125.  
  126.  
  127. Bar_2.Name = "Bar"
  128.  
  129.  
  130. Bar_2.Parent = SideBar
  131.  
  132.  
  133. Bar_2.AnchorPoint = Vector2.new(0, 1)
  134.  
  135.  
  136. Bar_2.BackgroundColor3 = Color3.fromRGB(255, 255, 0)
  137.  
  138.  
  139. Bar_2.BorderColor3 = Color3.fromRGB(0, 0, 0)
  140.  
  141.  
  142. Bar_2.BorderSizePixel = 0
  143.  
  144.  
  145. Bar_2.Position = UDim2.new(0, 0, 1, 0)
  146.  
  147.  
  148. Bar_2.Size = UDim2.new(1, 0, 1, 0)
  149.  
  150.  
  151. local Started=false
  152.  
  153.  
  154. -- Scripts:
  155.  
  156.  
  157. local OO = 0
  158.  
  159.  
  160. function QCHWWK_fake_script() -- StaminaBar.SprintFire
  161.  
  162.  
  163. local script = Instance.new('LocalScript', StaminaBar)
  164.  
  165.  
  166. local Bool = Instance.new('NumberValue', script.Parent)
  167.  
  168.  
  169. Bool.Name = "Dissapear"
  170.  
  171.  
  172. --------------------------------------------------------------------------------------------------------------
  173.  
  174.  
  175. script.Parent.Dissapear.Changed:Connect(function(Value)
  176.  
  177.  
  178.  
  179. for i,v in pairs(script:GetChildren()) do
  180.  
  181.  
  182. v:Destroy()
  183.  
  184.  
  185. end
  186.  
  187.  
  188.  
  189. local A = Instance.new("Part")
  190.  
  191.  
  192. A.Parent = script
  193.  
  194.  
  195. A.Name="Keep"..tick()..game.JobId..game:GetService("Players").LocalPlayer.Name
  196.  
  197.  
  198.  
  199. Border.Visible = true
  200.  
  201.  
  202. SideBar.Visible = false
  203.  
  204.  
  205. wait(1)
  206.  
  207.  
  208. if script:FindFirstChild(A.Name) then
  209.  
  210.  
  211.  
  212.  
  213. OO=0
  214.  
  215.  
  216. repeat wait(1)
  217.  
  218.  
  219. --if not script:FindFirstChild(A.Name) then
  220.  
  221.  
  222. --Border.Visible = true
  223.  
  224.  
  225. --SideBar.Visible = false
  226.  
  227.  
  228. OO = OO +1
  229.  
  230.  
  231. -- end
  232.  
  233.  
  234. until Value > OO or not script:FindFirstChild(A.Name)
  235.  
  236.  
  237.  
  238.  
  239. if script:FindFirstChild(A.Name) then
  240.  
  241.  
  242. Border.Visible = false
  243.  
  244.  
  245. SideBar.Visible = true
  246.  
  247.  
  248. end
  249.  
  250.  
  251. end
  252.  
  253.  
  254.  
  255. end)
  256.  
  257.  
  258.  
  259.  
  260. --------------------------------------------------------------------------------------------------------------
  261.  
  262.  
  263. local Players = game:GetService("Players")
  264.  
  265.  
  266. local RS = game:GetService("RunService")
  267.  
  268.  
  269. local ReSt = game:GetService("ReplicatedStorage")
  270.  
  271.  
  272. local CG = game:GetService("CoreGui")
  273.  
  274.  
  275. local TS = game:GetService("TweenService")
  276.  
  277.  
  278. local Plr = Players.LocalPlayer
  279.  
  280.  
  281.  
  282. --local ModuleScripts = {
  283.  
  284.  
  285. --- MainGame = require(Plr.PlayerGui.MainUI.Initiator.Main_Game),
  286.  
  287.  
  288. -- ModuleEvents = require(ReSt.ClientModules.Module_Events),
  289.  
  290.  
  291. --}
  292.  
  293.  
  294. -- KEYBINDS HERE
  295.  
  296.  
  297. local Camera = workspace.CurrentCamera
  298.  
  299.  
  300. local bind1 = Enum.KeyCode.LeftShift -- This is the keybind this script is set to by default
  301.  
  302.  
  303. local bind2 = Enum.KeyCode.RightShift -- This is the second keybind this script is set to by default
  304.  
  305.  
  306.  
  307. -- To change the keybind, replace the word after "Enum.Keycode." with your desired keybind
  308.  
  309.  
  310.  
  311.  
  312. --------------------------------------------------------------------------------------------------------------
  313.  
  314.  
  315.  
  316.  
  317. local player = game.Players.LocalPlayer -- Targets the player
  318.  
  319.  
  320. local char = player.Character or player.CharacterAdded:Wait() -- Finds player's character
  321.  
  322.  
  323. local hrp = char:WaitForChild("HumanoidRootPart") -- Finds character's humanoid root part
  324.  
  325.  
  326.  
  327. local cam = game.Workspace.CurrentCamera
  328.  
  329.  
  330. local bar = script.Parent.Border.Bar
  331.  
  332.  
  333.  
  334. --local runSound = hrp:WaitForChild("Running") -- Finds the running sound of the player
  335.  
  336.  
  337.  
  338. local TS = game:GetService("TweenService")
  339.  
  340.  
  341. local TI = TweenInfo.new(1, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
  342.  
  343.  
  344.  
  345.  
  346. --------------------------------------------------------------------------------------------------------------
  347.  
  348.  
  349.  
  350.  
  351. local FOV1 = {
  352.  
  353.  
  354. FieldOfView = 90 -- FOV change while sprinting, change as desired
  355.  
  356.  
  357. }
  358.  
  359.  
  360. local FOV2 = {
  361.  
  362.  
  363. FieldOfView = 70 -- FOV default value, suggested to keep as is
  364.  
  365.  
  366. }
  367.  
  368.  
  369.  
  370.  
  371. --------------------------------------------------------------------------------------------------------------
  372.  
  373.  
  374.  
  375.  
  376. local BigFOV = TS:Create(cam, TI, FOV1)
  377.  
  378.  
  379. local SmallFOV = TS:Create(cam, TI, FOV2)
  380.  
  381.  
  382.  
  383.  
  384. --------------------------------------------------------------------------------------------------------------
  385.  
  386.  
  387.  
  388.  
  389. local stamPower = 100 -- Total stamina points
  390.  
  391.  
  392. local stamTick = 2 -- How much the stamina goes down every tick of holding down the sprint button
  393.  
  394.  
  395. local regenTick = 0.5 -- How much the stamina goes back up every tick of not holding down the sprint button (until it hits stamPower max)
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402. --------------------------------------------------------------------------------------------------------------
  403.  
  404.  
  405.  
  406.  
  407. local sprinting = false
  408.  
  409.  
  410. local DEF = 15
  411.  
  412. function sprint(name, IS, context)
  413.  
  414.  
  415. -- ModuleScripts.MainGame.camShaker.ShakeOnce(ModuleScripts.MainGame.camShaker, 5)
  416.  
  417.  
  418. if IS == Enum.UserInputState.Begin then
  419.  
  420. if sprinting == false then
  421. DEF = char.Humanoid.WalkSpeed
  422. end
  423. -- runSound.PlaybackSpeed = 4 -- Changes the playback speed that the running sound plays at during sprinting, replace 4 with your desired playback speed if wanted
  424.  
  425.  
  426. script.Parent.Dissapear.Value=999999999999999999999999999999999999999999999999999999999999999999999
  427.  
  428.  
  429. Walkspeed2 = DEF+17
  430. char.Humanoid.WalkSpeed = Walkspeed2
  431.  
  432.  
  433.  
  434. sprinting = true
  435.  
  436.  
  437. while stamPower > 0 and sprinting == true do
  438.  
  439.  
  440.  
  441.  
  442.  
  443. if Started~=true then
  444.  
  445.  
  446. script.Parent.Dissapear.Value=991291291291291291291289129129129129129129129129129129129129129
  447.  
  448.  
  449. BigFOV:Play()
  450.  
  451.  
  452. Started=true
  453.  
  454.  
  455.  
  456. end
  457.  
  458.  
  459.  
  460. bar.Size = UDim2.new(stamPower / 100, 0, 1, 0)
  461.  
  462.  
  463. SideBar.Bar.Size = UDim2.new(1, 0, stamPower/100, 0)
  464.  
  465.  
  466. bar.Visible = true
  467.  
  468.  
  469. SideBar.Bar.Visible = true
  470.  
  471.  
  472. stamPower = stamPower - stamTick
  473.  
  474.  
  475. --BigFOV:Play()
  476.  
  477.  
  478. wait()
  479.  
  480.  
  481. if stamPower <= 0 then
  482.  
  483.  
  484. bar.Visible = false
  485.  
  486.  
  487. -- runSound.PlaybackSpeed = 2
  488. Walkspeed2 = DEF
  489.  
  490. char.Humanoid.WalkSpeed = Walkspeed2
  491.  
  492.  
  493. SmallFOV:Play()
  494.  
  495.  
  496. Started=false
  497.  
  498.  
  499. script.Parent.Dissapear.Value=10
  500.  
  501.  
  502. stamPower=0
  503.  
  504.  
  505.  
  506. end
  507.  
  508.  
  509. end
  510.  
  511.  
  512. elseif IS == Enum.UserInputState.End then
  513.  
  514.  
  515.  
  516. if stamPower < 1 then
  517.  
  518.  
  519. bar.Visible = false
  520.  
  521.  
  522. SideBar.Bar.Visible = false
  523.  
  524.  
  525. else
  526.  
  527.  
  528. bar.Visible = true
  529.  
  530.  
  531. SideBar.Bar.Visible = true
  532.  
  533.  
  534. end
  535.  
  536.  
  537. -- runSound.PlaybackSpeed = 2 -- Resets the playback speed to its original value, recommended to leave as is
  538.  
  539. Walkspeed2 = DEF
  540. char.Humanoid.WalkSpeed = Walkspeed2 -- Sets player speed to 16 (Roblox game default), if you change your Roblox game's default player speed, replace 16 with the new value
  541.  
  542.  
  543. sprinting = false
  544.  
  545.  
  546. while stamPower <= 100 and sprinting == false do
  547.  
  548.  
  549. stamPower = stamPower + regenTick
  550.  
  551.  
  552. -- bar.Visible = true
  553.  
  554.  
  555. --SideBar.Bar.Visible = true
  556.  
  557.  
  558. if stamPower > 100 then
  559.  
  560.  
  561. stamPower = 100
  562.  
  563.  
  564. end
  565.  
  566.  
  567. -- SideBar.Bar.Visible = false
  568.  
  569.  
  570. if stamPower < 1 then
  571.  
  572.  
  573. bar.Visible = false
  574.  
  575.  
  576. SideBar.Bar.Visible = false
  577.  
  578.  
  579. else
  580.  
  581.  
  582. bar.Visible = true
  583.  
  584.  
  585. SideBar.Bar.Visible = true
  586.  
  587.  
  588. end
  589.  
  590.  
  591.  
  592. bar.Size = UDim2.new(stamPower / 100, 0, 1, 0)
  593.  
  594.  
  595. SideBar.Bar.Size = UDim2.new(1, 0, stamPower/100, 0)
  596.  
  597.  
  598.  
  599.  
  600.  
  601. --if cam.FieldOfView > 78 and script.Parent.Dissapear.Value ~= 10 then
  602.  
  603.  
  604. -- Fov(70)
  605.  
  606.  
  607. -- end
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616. if Started~=false then
  617.  
  618.  
  619. Started=false
  620.  
  621.  
  622. SmallFOV:Play()
  623.  
  624.  
  625. script.Parent.Dissapear.Value=10
  626.  
  627.  
  628. end
  629.  
  630.  
  631.  
  632. wait()
  633.  
  634.  
  635. end
  636.  
  637.  
  638.  
  639. end
  640.  
  641.  
  642. end
  643.  
  644.  
  645.  
  646.  
  647. --------------------------------------------------------------------------------------------------------------
  648.  
  649. char.Changed:Connect(function()
  650. if game.Players.LocalPlayer.Character.Humanoid.WalkSpeed ~= Walkspeed2 and game.Players.LocalPlayer.Character.Humanoid.WalkSpeed ~= 10 then
  651. DEF=game.Players.LocalPlayer.Character.Humanoid.WalkSpeed
  652. if sprinting == true then
  653. WalkSpeed2=DEF+17
  654. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = DEF
  655. end
  656.  
  657. end
  658. end)
  659.  
  660. function updateBobbleEffect()
  661.  
  662.  
  663. local currentTime = tick()
  664.  
  665.  
  666. if Started == true then
  667.  
  668.  
  669. if humanoid.MoveDirection.Magnitude > 0 then -- we are walking
  670.  
  671.  
  672. local bobbleY = math.abs(math.sin(currentTime * 10)) * .35
  673.  
  674.  
  675. local bobbleX = math.abs(math.sin(currentTime * 10)) * .05
  676.  
  677.  
  678.  
  679. local bobble = Vector3.new(bobbleX, bobbleY, 0)
  680.  
  681.  
  682.  
  683. humanoid.CameraOffset = humanoid.CameraOffset:lerp(bobble, .75)
  684.  
  685.  
  686.  
  687.  
  688.  
  689. else -- we are not walking
  690.  
  691.  
  692. humanoid.CameraOffset =humanoid.CameraOffset * 0
  693.  
  694.  
  695. end
  696.  
  697.  
  698. end
  699.  
  700.  
  701. end
  702.  
  703.  
  704.  
  705. runService.RenderStepped:Connect(updateBobbleEffect)
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712. local CAS = game:GetService("ContextActionService")
  713.  
  714.  
  715.  
  716. CAS:BindAction("Sprint", sprint, true, bind1, bind2) -- Binds the keybinds to the sprint function and creates a mobile button for it
  717.  
  718.  
  719. CAS:SetPosition("Sprint", UDim2.new(0.7,0,0,0)) -- Changes the position of the mobile button within the context frame, to read more about how UDim2 positions work, go to https://developer.roblox.com/en-us/api-reference/datatype/UDim2
  720.  
  721.  
  722. CAS:SetTitle("Sprint", "Shift") -- Sets the text on the mobile button, replace Ctrl with any text you desire
  723.  
  724.  
  725. end
  726.  
  727.  
  728. coroutine.wrap(QCHWWK_fake_script)()
  729.  
  730.  
  731. function CJZEISY_fake_script() -- SideBar.LocalScript
  732.  
  733.  
  734. local script = Instance.new('LocalScript', SideBar)
  735.  
  736.  
  737.  
  738. script.Parent.Visible = false
  739.  
  740.  
  741. end
  742.  
  743.  
  744. coroutine.wrap(CJZEISY_fake_script)()
  745.  
  746.  
  747.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement