Advertisement
AjareliVajkaci

FE SUBMERGE ROBLOX SCRIPT [GO UNDERGROUND] MOBILE

Dec 12th, 2024
17,079
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.73 KB | Gaming | 0 0
  1. --made by Muscle_legends2021 (Gio)
  2. --YouTube: GioBolqvi
  3. local player = game.Players.LocalPlayer
  4. local character = player.Character or player.CharacterAdded:Wait()
  5. local humanoid = character:WaitForChild("Humanoid")
  6. local rootPart = character:WaitForChild("HumanoidRootPart")
  7. local camera = workspace.CurrentCamera
  8. local submerged = false
  9. local swimSpeed = 20 -- CHANGE SPEED OF SUBMERGE HERE
  10. local submergeOffset = 6.45 -- CHANGE DEEPNESS OF SUBMERGE HERE
  11. local riseMultiplier = 1.1
  12. local noclipParts = {}
  13. local originalCameraCFrame = nil
  14. local savedSubmergePosition = nil
  15. local animationPlaying = false
  16. local animationToggleButton = nil
  17.  
  18. local playerData = {
  19. buttonPosition = UDim2.new(1, -175, 0.5, -100),
  20. animationButtonPosition = UDim2.new(1, -175, 0.5, -40)
  21. }
  22.  
  23. local animation = Instance.new("Animation")
  24. animation.AnimationId = "rbxassetid://536135263"
  25. local animator = humanoid:WaitForChild("Animator")
  26. local animationTrack = animator:LoadAnimation(animation)
  27. animationTrack.Looped = false
  28.  
  29. local gui = Instance.new("ScreenGui")
  30. gui.Name = "SubmergeGUI"
  31. gui.Parent = player:WaitForChild("PlayerGui")
  32.  
  33. local button = Instance.new("TextButton")
  34. button.Name = "SubmergeButton"
  35. button.Parent = gui
  36. button.Size = UDim2.new(0, 150, 0, 50)
  37. button.Position = playerData.buttonPosition
  38. button.AnchorPoint = Vector2.new(1, 0.5)
  39. button.BackgroundColor3 = Color3.fromRGB(0, 100, 200)
  40. button.TextColor3 = Color3.new(1, 1, 1)
  41. button.Text = "Submerge"
  42. button.Font = Enum.Font.GothamBold
  43. button.TextSize = 18
  44. button.TextStrokeTransparency = 0
  45. button.TextStrokeColor3 = Color3.new(0, 0, 0)
  46. button.BackgroundTransparency = 0.2
  47. button.BorderSizePixel = 0
  48. button.AutoButtonColor = true
  49. button.Draggable = true
  50.  
  51. local corner = Instance.new("UICorner")
  52. corner.CornerRadius = UDim.new(0, 15)
  53. corner.Parent = button
  54.  
  55. animationToggleButton = Instance.new("TextButton")
  56. animationToggleButton.Name = "AnimationToggleButton"
  57. animationToggleButton.Parent = gui
  58. animationToggleButton.Size = UDim2.new(0, 150, 0, 50)
  59. animationToggleButton.Position = playerData.animationButtonPosition
  60. animationToggleButton.AnchorPoint = Vector2.new(1, 0.5)
  61. animationToggleButton.BackgroundColor3 = Color3.fromRGB(0, 200, 100)
  62. animationToggleButton.TextColor3 = Color3.new(1, 1, 1)
  63. animationToggleButton.Text = "Arm up: On/Off"
  64. animationToggleButton.Font = Enum.Font.GothamBold
  65. animationToggleButton.TextSize = 18
  66. animationToggleButton.TextStrokeTransparency = 0
  67. animationToggleButton.TextStrokeColor3 = Color3.new(0, 0, 0)
  68. animationToggleButton.BackgroundTransparency = 0.2
  69. animationToggleButton.BorderSizePixel = 0
  70. animationToggleButton.AutoButtonColor = true
  71. animationToggleButton.Draggable = true
  72.  
  73. local animCorner = Instance.new("UICorner")
  74. animCorner.CornerRadius = UDim.new(0, 15)
  75. animCorner.Parent = animationToggleButton
  76.  
  77. local highlight = Instance.new("Highlight")
  78. highlight.Enabled = false
  79. highlight.FillTransparency = 1
  80. highlight.OutlineTransparency = 0
  81. highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
  82. highlight.Parent = character
  83.  
  84. for _, part in pairs(character:GetChildren()) do
  85. if part.Name == "Left Arm" or part.Name == "Right Arm" then
  86. table.insert(noclipParts, part)
  87. end
  88. end
  89.  
  90. local function toggleNoclip(state)
  91. for _, part in pairs(character:GetDescendants()) do
  92. if part:IsA("BasePart") then
  93. if table.find(noclipParts, part) then
  94. part.CanCollide = false
  95. else
  96. part.CanCollide = not state
  97. end
  98. end
  99. end
  100. end
  101.  
  102. local function submerge()
  103. originalCameraCFrame = camera.CFrame
  104. camera.CameraType = Enum.CameraType.Custom
  105. savedSubmergePosition = rootPart.Position - Vector3.new(0, submergeOffset, 0)
  106. toggleNoclip(true)
  107. rootPart.CFrame = CFrame.new(savedSubmergePosition)
  108. humanoid.PlatformStand = true
  109. highlight.Enabled = true
  110. submerged = true
  111. button.Text = "Rise Up"
  112. end
  113.  
  114. local function surface()
  115. toggleNoclip(false)
  116. humanoid.PlatformStand = false
  117. rootPart.CFrame = rootPart.CFrame + Vector3.new(0, submergeOffset * riseMultiplier, 0)
  118. highlight.Enabled = false
  119. submerged = false
  120. button.Text = "Submerge"
  121. camera.CFrame = originalCameraCFrame
  122. end
  123.  
  124. local function toggleAnimation()
  125. if animationPlaying then
  126. animationTrack:Stop()
  127. animationToggleButton.Text = "Arm up: On/Off"
  128. animationPlaying = false
  129. else
  130. animationPlaying = true
  131. animationToggleButton.Text = "Arm up: Off"
  132. while animationPlaying do
  133. animationTrack:Play()
  134. animationTrack.TimePosition = 0.2
  135. task.wait(0.03)
  136. end
  137. end
  138. end
  139.  
  140. game:GetService("RunService").Stepped:Connect(function()
  141. if submerged then
  142. toggleNoclip(true)
  143. end
  144. end)
  145.  
  146. game:GetService("RunService").RenderStepped:Connect(function()
  147. if submerged then
  148. rootPart.CFrame = CFrame.new(rootPart.Position.X, savedSubmergePosition.Y, rootPart.Position.Z)
  149. rootPart.Velocity = humanoid.MoveDirection * swimSpeed
  150. end
  151. end)
  152.  
  153. button.MouseButton1Click:Connect(function()
  154. if submerged then
  155. surface()
  156. else
  157. submerge()
  158. end
  159. end)
  160.  
  161. animationToggleButton.MouseButton1Click:Connect(toggleAnimation)
  162.  
  163. button:GetPropertyChangedSignal("Position"):Connect(function()
  164. playerData.buttonPosition = button.Position
  165. end)
  166.  
  167. animationToggleButton:GetPropertyChangedSignal("Position"):Connect(function()
  168. playerData.animationButtonPosition = animationToggleButton.Position
  169. end)
  170.  
  171. game.Players.LocalPlayer.CharacterAdded:Connect(function()
  172. task.wait(0.01)
  173. button.Position = playerData.buttonPosition
  174. animationToggleButton.Position = playerData.animationButtonPosition
  175. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement