Thesisa

Custom Duels - Reach Script (#1)

Aug 26th, 2021 (edited)
4,442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.52 KB | None | 0 0
  1. local ScreenGui = Instance.new("ScreenGui")
  2. local Frame = Instance.new("Frame")
  3. local InvertBtn = Instance.new("TextButton")
  4. local InvertTxt = Instance.new("TextLabel")
  5. local RangeSubtractBtn = Instance.new("TextButton")
  6. local RangeAddBtn = Instance.new("TextButton")
  7. local RangeTxt = Instance.new("TextLabel")
  8. local ToggleBtn = Instance.new("TextButton")
  9. local ToggleTxt = Instance.new("TextLabel")
  10. local OpenArrowFrame = Instance.new("Frame")
  11. local OpenArrowBtn = Instance.new("TextButton")
  12. local BackArrowFrame = Instance.new("Frame")
  13. local BackArrowBtn = Instance.new("TextButton")
  14.  
  15. --Properties:
  16.  
  17. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  18. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  19. ScreenGui.ResetOnSpawn = false
  20.  
  21. Frame.Parent = ScreenGui
  22. Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  23. Frame.Position = UDim2.new(-0.13, 0, 0.349999994, 0)
  24. Frame.Size = UDim2.new(0.125, 0, 0.300000012, 0)
  25. Frame.Style = Enum.FrameStyle.RobloxRound
  26.  
  27. InvertBtn.Name = "InvertBtn"
  28. InvertBtn.Parent = Frame
  29. InvertBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  30. InvertBtn.Position = UDim2.new(0.649999976, 0, 0.75, 0)
  31. InvertBtn.Size = UDim2.new(0.349999994, 0, 0.25, 0)
  32. InvertBtn.Style = Enum.ButtonStyle.RobloxRoundDropdownButton
  33. InvertBtn.Font = Enum.Font.Cartoon
  34. InvertBtn.Text = "Off"
  35. InvertBtn.TextColor3 = Color3.fromRGB(0, 0, 0)
  36. InvertBtn.TextSize = 18.000
  37. InvertBtn.TextWrapped = true
  38.  
  39. InvertTxt.Name = "InvertTxt"
  40. InvertTxt.Parent = Frame
  41. InvertTxt.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  42. InvertTxt.BackgroundTransparency = 1.000
  43. InvertTxt.Position = UDim2.new(0, 0, 0.75, 0)
  44. InvertTxt.Size = UDim2.new(0.649999976, 0, 0.25, 0)
  45. InvertTxt.Font = Enum.Font.Cartoon
  46. InvertTxt.Text = "Invert:"
  47. InvertTxt.TextColor3 = Color3.fromRGB(255, 255, 255)
  48. InvertTxt.TextSize = 18.000
  49.  
  50. RangeSubtractBtn.Name = "RangeSubtractBtn"
  51. RangeSubtractBtn.Parent = Frame
  52. RangeSubtractBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  53. RangeSubtractBtn.Position = UDim2.new(0.714999974, 0, 0.449999988, 0)
  54. RangeSubtractBtn.Rotation = 90.000
  55. RangeSubtractBtn.Size = UDim2.new(0.224999994, 0, 0.275000006, 0)
  56. RangeSubtractBtn.Style = Enum.ButtonStyle.RobloxRoundDropdownButton
  57. RangeSubtractBtn.Font = Enum.Font.Cartoon
  58. RangeSubtractBtn.Text = ">"
  59. RangeSubtractBtn.TextColor3 = Color3.fromRGB(0, 0, 0)
  60. RangeSubtractBtn.TextSize = 14.000
  61. RangeSubtractBtn.TextWrapped = true
  62.  
  63. RangeAddBtn.Name = "RangeAddBtn"
  64. RangeAddBtn.Parent = Frame
  65. RangeAddBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  66. RangeAddBtn.Position = UDim2.new(0.714999974, 0, 0.25, 0)
  67. RangeAddBtn.Rotation = 90.000
  68. RangeAddBtn.Size = UDim2.new(0.224999994, 0, 0.275000006, 0)
  69. RangeAddBtn.Style = Enum.ButtonStyle.RobloxRoundDropdownButton
  70. RangeAddBtn.Font = Enum.Font.Cartoon
  71. RangeAddBtn.Text = "<"
  72. RangeAddBtn.TextColor3 = Color3.fromRGB(0, 0, 0)
  73. RangeAddBtn.TextSize = 14.000
  74. RangeAddBtn.TextWrapped = true
  75.  
  76. RangeTxt.Name = "RangeTxt"
  77. RangeTxt.Parent = Frame
  78. RangeTxt.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  79. RangeTxt.BackgroundTransparency = 1.000
  80. RangeTxt.Position = UDim2.new(0, 0, 0.375, 0)
  81. RangeTxt.Size = UDim2.new(0.649999976, 0, 0.25, 0)
  82. RangeTxt.Font = Enum.Font.Cartoon
  83. RangeTxt.Text = "Range: 8"
  84. RangeTxt.TextColor3 = Color3.fromRGB(255, 255, 255)
  85. RangeTxt.TextSize = 18.000
  86.  
  87. ToggleBtn.Name = "ToggleBtn"
  88. ToggleBtn.Parent = Frame
  89. ToggleBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  90. ToggleBtn.Position = UDim2.new(0.649999976, 0, 0, 0)
  91. ToggleBtn.Size = UDim2.new(0.349999994, 0, 0.25, 0)
  92. ToggleBtn.Style = Enum.ButtonStyle.RobloxRoundDropdownButton
  93. ToggleBtn.Font = Enum.Font.Cartoon
  94. ToggleBtn.Text = "Off"
  95. ToggleBtn.TextColor3 = Color3.fromRGB(0, 0, 0)
  96. ToggleBtn.TextSize = 18.000
  97. ToggleBtn.TextWrapped = true
  98.  
  99. ToggleTxt.Name = "ToggleTxt"
  100. ToggleTxt.Parent = Frame
  101. ToggleTxt.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  102. ToggleTxt.BackgroundTransparency = 1.000
  103. ToggleTxt.Size = UDim2.new(0.649999976, 0, 0.25, 0)
  104. ToggleTxt.Font = Enum.Font.Cartoon
  105. ToggleTxt.Text = "Toggle:"
  106. ToggleTxt.TextColor3 = Color3.fromRGB(255, 255, 255)
  107. ToggleTxt.TextSize = 18.000
  108.  
  109. OpenArrowFrame.Name = "OpenArrowFrame"
  110. OpenArrowFrame.Parent = Frame
  111. OpenArrowFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  112. OpenArrowFrame.Position = UDim2.new(1.10000002, 0, 0.300000012, 0)
  113. OpenArrowFrame.Size = UDim2.new(0.300000012, 0, 0.400000006, 0)
  114. OpenArrowFrame.Style = Enum.FrameStyle.RobloxRound
  115.  
  116. OpenArrowBtn.Name = "OpenArrowBtn"
  117. OpenArrowBtn.Parent = OpenArrowFrame
  118. OpenArrowBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  119. OpenArrowBtn.BackgroundTransparency = 1.000
  120. OpenArrowBtn.Size = UDim2.new(1, 0, 1, 0)
  121. OpenArrowBtn.Font = Enum.Font.Cartoon
  122. OpenArrowBtn.Text = ">"
  123. OpenArrowBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  124. OpenArrowBtn.TextSize = 25.000
  125. OpenArrowBtn.TextWrapped = true
  126.  
  127. BackArrowFrame.Name = "BackArrowFrame"
  128. BackArrowFrame.Parent = Frame
  129. BackArrowFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  130. BackArrowFrame.Position = UDim2.new(-0.400000006, 0, 0.300000012, 0)
  131. BackArrowFrame.Size = UDim2.new(0.300000012, 0, 0.400000006, 0)
  132. BackArrowFrame.Style = Enum.FrameStyle.RobloxRound
  133.  
  134. BackArrowBtn.Name = "BackArrowBtn"
  135. BackArrowBtn.Parent = BackArrowFrame
  136. BackArrowBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  137. BackArrowBtn.BackgroundTransparency = 1.000
  138. BackArrowBtn.Size = UDim2.new(1, 0, 1, 0)
  139. BackArrowBtn.Font = Enum.Font.Cartoon
  140. BackArrowBtn.Text = "<"
  141. BackArrowBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  142. BackArrowBtn.TextSize = 25.000
  143. BackArrowBtn.TextWrapped = true
  144.  
  145. local range = 4 -- DO RANGE IN 4S
  146. local thing = 0
  147. local toggle = false
  148. local opened = false
  149. local invert = false
  150. local checkPosOnce = false
  151.  
  152. OpenArrowBtn.MouseButton1Click:Connect(function()
  153. if opened == false then
  154. opened = true
  155. OpenArrowFrame.Visible = false
  156. Frame:TweenPosition(UDim2.new(0.04, 0, 0.35, 0), "Out", "Quad", .25)
  157. end
  158. end)
  159.  
  160. BackArrowBtn.MouseButton1Click:Connect(function()
  161. if opened == true then
  162. OpenArrowFrame.Visible = true
  163. Frame:TweenPosition(UDim2.new(-.13, 0, 0.35, 0), "Out", "Quad", .25)
  164. wait(.25)
  165. opened = false
  166. end
  167. end)
  168.  
  169. ToggleBtn.MouseButton1Click:Connect(function()
  170. if toggle == false then
  171. checkPosOnce = false
  172. toggle = true
  173. ToggleBtn.Text = "On"
  174. elseif toggle == true then
  175. toggle = false
  176. ToggleBtn.Text = "Off"
  177. end
  178. end)
  179.  
  180. InvertBtn.MouseButton1Click:Connect(function()
  181. if invert == false then
  182. invert = true
  183. InvertBtn.Text = "On"
  184. elseif invert == true then
  185. invert = false
  186. InvertBtn.Text = "Off"
  187. end
  188. end)
  189.  
  190. RangeAddBtn.MouseButton1Click:Connect(function()
  191. range = range + 1
  192. RangeTxt.Text = "Range: " .. tostring(range + 4)
  193. end)
  194.  
  195. RangeSubtractBtn.MouseButton1Click:Connect(function()
  196. if range + 3 < 4 then else
  197. range = range - 1
  198. RangeTxt.Text = "Range: " .. tostring(range + 4)
  199. end
  200. end)
  201.  
  202. local lastOne = false
  203.  
  204. game:GetService"RunService".RenderStepped:Connect(function()
  205. if toggle == true then
  206. pcall(function()
  207. local addVal = -4 * (thing / 4)
  208.  
  209. if lastOne == true then
  210. addVal = -((range - thing) + (4 * (thing / 4)))
  211. end
  212.  
  213. if game:GetService("Workspace")[game.Players.LocalPlayer.Name]:FindFirstChild("Sword") then
  214. game:GetService("Workspace")[game.Players.LocalPlayer.Name].Sword.GripPos=Vector3.new(0, 0, -2 + addVal)
  215. end
  216.  
  217. if game:GetService("Workspace")[game.Players.LocalPlayer.Name]:FindFirstChild("MatSword") then
  218. game:GetService("Workspace")[game.Players.LocalPlayer.Name].MatSword.GripPos=Vector3.new(0, 0, -2 + addVal)
  219. end
  220.  
  221. if lastOne == true then
  222. thing = 0
  223. lastOne = false
  224.  
  225. if invert == true then
  226. thing = -range / 2
  227. end
  228. elseif lastOne == false then
  229. if thing + 4 < range then
  230. thing = thing + 4
  231. else
  232. lastOne = true
  233. end
  234. end
  235. end)
  236. elseif toggle == false then
  237. pcall(function()
  238. if checkPosOnce == false then
  239. checkPosOnce = true
  240. if game:GetService("Workspace")[game.Players.LocalPlayer.Name]:FindFirstChild("Sword") then
  241. game:GetService("Workspace")[game.Players.LocalPlayer.Name].Sword.GripPos=Vector3.new(0, 0, -2)
  242. end
  243.  
  244. if game:GetService("Workspace")[game.Players.LocalPlayer.Name]:FindFirstChild("MatSword") then
  245. game:GetService("Workspace")[game.Players.LocalPlayer.Name].MatSword.GripPos=Vector3.new(0, 0, -2)
  246. end
  247. end
  248. end)
  249. end
  250. end)
Add Comment
Please, Sign In to add comment