TheUnknownDiscord

railgu

Oct 9th, 2022 (edited)
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.78 KB | None | 0 0
  1. local ignorelist = {}
  2. for i, wha in pairs(workspace:GetDescendants()) do
  3. if wha:IsA("Model") and wha:FindFirstChildWhichIsA("Humanoid") then
  4. table.insert(ignorelist,wha)
  5. end
  6. end
  7. workspace.DescendantAdded:Connect(function(wha)
  8. if wha:IsA("Model") and wha:FindFirstChildWhichIsA("Humanoid") then
  9. table.insert(ignorelist,wha)
  10. end
  11. end)
  12. e = Instance.new("RemoteEvent",owner.Character)
  13. local hed = Instance.new("Weld",owner.Character.Torso)
  14. hed.Part0 = owner.Character.Head
  15. hed.Part1 = hed.Parent
  16. hed.C0 = CFrame.new(0,-0.5,0)
  17. hed.C1 = CFrame.new(0,1,0)
  18. hed.Enabled = false
  19. local s = Instance.new("Sound")
  20. s.PlayOnRemove = true
  21. s.Volume = 0.6
  22. s.SoundId = "rbxassetid://6738503253"
  23. local tool = Instance.new("Tool",owner.Backpack)
  24. tool.Grip = CFrame.new(0.3,0.1,0.8) * CFrame.Angles(math.rad(-0.6),math.rad(-1.5),0)
  25. tool.Name = "railgu"
  26. local armw = Instance.new("Weld",owner.Character.Torso)
  27. armw.Part0 = owner.Character["Right Arm"]
  28. armw.Part1 = owner.Character.Torso
  29. armw.C1 = CFrame.new(1.5,0.5,0)
  30. armw.Enabled = false
  31. armw.C0 = CFrame.new(0,0.5,0) * CFrame.Angles(math.rad(-90),0,0)
  32. local part = Instance.new("Part",tool)
  33. part.Name = "Handle"
  34. part.Size = Vector3.new(6.883,11.953,33.644) * 0.145
  35. local m = Instance.new("SpecialMesh",part)
  36. m.MeshId = "rbxassetid://10522578887"
  37. m.TextureId = "rbxassetid://10522656175"
  38. m.Scale = Vector3.new(1,1,1) * 0.15
  39. local alpha = Instance.new("Texture",part)
  40. alpha.StudsPerTileU = 3
  41. alpha.StudsPerTileV = 3
  42. alpha.Texture = "rbxassetid://11259851647"
  43. alpha.Color3 = Color3.new(0,10000000000000,10000000000000)
  44. local at = Instance.new("Attachment",part)
  45. at.CFrame = CFrame.new(0.05,0.45,0.45) * CFrame.Angles(math.rad(-45),0,0)
  46. local light = Instance.new("PointLight",at)
  47. light.Color = Color3.fromRGB(0,170, 255)
  48. light.Brightness = 3
  49. light.Range = 5
  50. local part2 = Instance.new("Part",part)
  51. part2.CanCollide = false
  52. part2.Size = Vector3.new(4.352, 4.509, 27.894) * 0.15
  53. local m2 = Instance.new("SpecialMesh",part2)
  54. m2.MeshId = "rbxassetid://10522577480"
  55. m2.TextureId = "rbxassetid://10522656175"
  56. m2.Scale = Vector3.new(1,1,1) * 0.15
  57. local weld = Instance.new("Weld",part)
  58. weld.Part0 = part2
  59. weld.Part1 = part
  60. weld.C1 = CFrame.new(-0.45,-0.4,-0.8)
  61. weld.C0 = CFrame.new(0,0,2.05)
  62. local part3 = Instance.new("Part",part)
  63. part3.CanCollide = false
  64. part3.Size = Vector3.new(4.352, 4.509, 27.894) * 0.15
  65. local m3 = Instance.new("SpecialMesh",part3)
  66. m3.MeshId = "rbxassetid://10522579285"
  67. m3.TextureId = "rbxassetid://10522656175"
  68. m3.Scale = Vector3.new(1,1,1) * 0.15
  69. local weld2 = Instance.new("Weld",part)
  70. weld2.Part0 = part3
  71. weld2.Part1 = part
  72. weld2.C1 = CFrame.new(0.55,-0.4,-0.8)
  73. weld2.C0 = CFrame.new(0,0,2.05)
  74. local part4 = Instance.new("Part",part)
  75. part4.CanCollide = false
  76. part4.Size = Vector3.new(4.151, 5.202, 28.434) * 0.15
  77. local m4 = Instance.new("SpecialMesh",part4)
  78. m4.MeshId = "rbxassetid://10522578576"
  79. m4.TextureId = "rbxassetid://10522656175"
  80. m4.Scale = Vector3.new(1,1,1) * 0.15
  81. local weld3 = Instance.new("Weld",part)
  82. weld3.Part0 = part4
  83. weld3.Part1 = part
  84. weld3.C1 = CFrame.new(0.05,0.4,-0.8)
  85. weld3.C0 = CFrame.new(0,0,2.05)
  86. local part5 = Instance.new("Part",part)
  87. part5.CanCollide = false
  88. part5.Size = Vector3.new(1,1,1) * 0.15
  89. local m5 = Instance.new("SpecialMesh",part5)
  90. m5.MeshId = "rbxassetid://10522578076"
  91. m5.TextureId = "rbxassetid://10522656175"
  92. m5.Scale = Vector3.new(1,1,1) * 0.15
  93. local weld4 = Instance.new("Weld",part)
  94. weld4.Part0 = part5
  95. weld4.Part1 = part
  96. weld4.C1 = CFrame.new(-0.5,-0.15,-0.3)
  97. local part5 = Instance.new("Part",part)
  98. part5.CanCollide = false
  99. part5.Size = Vector3.new(1,1,1) * 0.15
  100. local m5 = Instance.new("SpecialMesh",part5)
  101. m5.MeshId = "rbxassetid://10522577725"
  102. m5.TextureId = "rbxassetid://10522656175"
  103. m5.Scale = Vector3.new(1,1,1) * 0.15
  104. local weld4 = Instance.new("Weld",part3)
  105. weld4.Part0 = part5
  106. weld4.Part1 = part3
  107. weld4.C1 = CFrame.new(-0.03,0,0.3 + 0.85) * CFrame.Angles(0,0,math.rad(-45))
  108. weld4.C0 = CFrame.new(0,-0.25,0)
  109. local part5 = Instance.new("Part",part)
  110. part5.CanCollide = false
  111. part5.Size = Vector3.new(1,1,1) * 0.15
  112. local m5 = Instance.new("SpecialMesh",part5)
  113. m5.MeshId = "rbxassetid://10522577725"
  114. m5.TextureId = "rbxassetid://10522656175"
  115. m5.Scale = Vector3.new(1,1,1) * 0.15
  116. local weld4 = Instance.new("Weld",part3)
  117. weld4.Part0 = part5
  118. weld4.Part1 = part3
  119. weld4.C1 = CFrame.new(-0.025,0,0.3125) * CFrame.Angles(0,0,math.rad(-45))
  120. weld4.C0 = CFrame.new(0,-0.25,0)
  121. local part5 = Instance.new("Part",part)
  122. part5.CanCollide = false
  123. part5.Size = Vector3.new(1,1,1) * 0.15
  124. local m5 = Instance.new("SpecialMesh",part5)
  125. m5.MeshId = "rbxassetid://10522577725"
  126. m5.TextureId = "rbxassetid://10522656175"
  127. m5.Scale = Vector3.new(1,1,1) * 0.15
  128. local weld4 = Instance.new("Weld",part3)
  129. weld4.Part0 = part5
  130. weld4.Part1 = part3
  131. weld4.C1 = CFrame.new(0.075,0,-(0.525 + 0.85)) * CFrame.Angles(0,0,math.rad(-45))
  132. weld4.C0 = CFrame.new(0,-0.185,0)
  133. local part5 = Instance.new("Part",part)
  134. part5.CanCollide = false
  135. part5.Size = Vector3.new(1,1,1) * 0.15
  136. local m5 = Instance.new("SpecialMesh",part5)
  137. m5.MeshId = "rbxassetid://10522577725"
  138. m5.TextureId = "rbxassetid://10522656175"
  139. m5.Scale = Vector3.new(1,1,1) * 0.15
  140. local weld4 = Instance.new("Weld",part3)
  141. weld4.Part0 = part5
  142. weld4.Part1 = part3
  143. weld4.C1 = CFrame.new(0.025,0,-0.525) * CFrame.Angles(0,0,math.rad(-45))
  144. weld4.C0 = CFrame.new(0,-0.2,0)
  145. local part5 = Instance.new("Part",part)
  146. part5.CanCollide = false
  147. part5.Size = Vector3.new(1,1,1) * 0.15
  148. local m5 = Instance.new("SpecialMesh",part5)
  149. m5.MeshId = "rbxassetid://10522577725"
  150. m5.TextureId = "rbxassetid://10522656175"
  151. m5.Scale = Vector3.new(1,1,1) * 0.15
  152. local weld4 = Instance.new("Weld",part2)
  153. weld4.Part0 = part5
  154. weld4.Part1 = part2
  155. weld4.C1 = CFrame.new(0.03,0,0.3 + 0.85) * CFrame.Angles(0,0,math.rad(45))
  156. weld4.C0 = CFrame.new(0,-0.25,0)
  157. local part5 = Instance.new("Part",part)
  158. part5.CanCollide = false
  159. part5.Size = Vector3.new(1,1,1) * 0.15
  160. local m5 = Instance.new("SpecialMesh",part5)
  161. m5.MeshId = "rbxassetid://10522577725"
  162. m5.TextureId = "rbxassetid://10522656175"
  163. m5.Scale = Vector3.new(1,1,1) * 0.15
  164. local weld4 = Instance.new("Weld",part2)
  165. weld4.Part0 = part5
  166. weld4.Part1 = part2
  167. weld4.C1 = CFrame.new(0.025,0,0.3125) * CFrame.Angles(0,0,math.rad(45))
  168. weld4.C0 = CFrame.new(0,-0.25,0)
  169. local part5 = Instance.new("Part",part)
  170. part5.CanCollide = false
  171. part5.Size = Vector3.new(1,1,1) * 0.15
  172. local m5 = Instance.new("SpecialMesh",part5)
  173. m5.MeshId = "rbxassetid://10522577725"
  174. m5.TextureId = "rbxassetid://10522656175"
  175. m5.Scale = Vector3.new(1,1,1) * 0.15
  176. local weld4 = Instance.new("Weld",part2)
  177. weld4.Part0 = part5
  178. weld4.Part1 = part2
  179. weld4.C1 = CFrame.new(-0.075,0,-(0.525 + 0.85)) * CFrame.Angles(0,0,math.rad(45))
  180. weld4.C0 = CFrame.new(0,-0.185,0)
  181. local part5 = Instance.new("Part",part)
  182. part5.CanCollide = false
  183. part5.Size = Vector3.new(1,1,1) * 0.15
  184. local m5 = Instance.new("SpecialMesh",part5)
  185. m5.MeshId = "rbxassetid://10522577725"
  186. m5.TextureId = "rbxassetid://10522656175"
  187. m5.Scale = Vector3.new(1,1,1) * 0.15
  188. local weld4 = Instance.new("Weld",part2)
  189. weld4.Part0 = part5
  190. weld4.Part1 = part2
  191. weld4.C1 = CFrame.new(-0.025,0,-0.525) * CFrame.Angles(0,0,math.rad(45))
  192. weld4.C0 = CFrame.new(0,-0.2,0)
  193. local tweenService = game:GetService("TweenService")
  194. local tweenInfo = TweenInfo.new(0.15,Enum.EasingStyle.Back,Enum.EasingDirection.Out,0,true)
  195. local goal = {}
  196. goal.C0 = CFrame.new(0,0,2.05) * CFrame.Angles(math.rad(-35),0,0)
  197. local tween = tweenService:Create(weld3, tweenInfo, goal)
  198. local goal2 = {}
  199. goal2.C0 = CFrame.new(0,0,2.05) * CFrame.Angles(math.rad(25),math.rad(25),math.rad(-50))
  200. goal2.C1 = weld2.C1 * CFrame.Angles(0,0,math.rad(-50))
  201. local tween2 = tweenService:Create(weld2, tweenInfo, goal2)
  202. local goal3 = {}
  203. goal3.C0 = CFrame.new(0,0,2.05) * CFrame.Angles(math.rad(25),math.rad(-25),math.rad(50))
  204. goal3.C1 = weld.C1 * CFrame.Angles(0,0,math.rad(50))
  205. local tween3 = tweenService:Create(weld, tweenInfo, goal3)
  206. local tweenInfo = TweenInfo.new(0.2,Enum.EasingStyle.Sine,Enum.EasingDirection.Out)
  207. local goal4 = {}
  208. goal4.C0 = CFrame.new(0,-0.8,-0.1) * CFrame.Angles(math.rad(-110),0,0)
  209. local tween4 = tweenService:Create(armw, tweenInfo, goal4)
  210. local tweenInfo = TweenInfo.new(0.1,Enum.EasingStyle.Back,Enum.EasingDirection.Out)
  211. local goal5 = {}
  212. goal5.C0 = CFrame.new(0,-0.3,-0.05) * CFrame.Angles(math.rad(-85),0,0)
  213. local tween5 = tweenService:Create(armw, tweenInfo, goal5)
  214. local tweenInfo = TweenInfo.new(0.15,Enum.EasingStyle.Quart,Enum.EasingDirection.Out)
  215. local goal6 = {}
  216. goal6.C0 = CFrame.new(0,0.5,0) * CFrame.Angles(math.rad(-90),0,0)
  217. local tween6 = tweenService:Create(armw, tweenInfo, goal6)
  218. local tweenInfo = TweenInfo.new(0.1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,true)
  219. local goa = {}
  220. goa.C0 = owner.Character.HumanoidRootPart:FindFirstChildWhichIsA("Motor6D").C0 * CFrame.Angles(math.rad(-5),0,0)
  221. local twee = tweenService:Create(owner.Character.HumanoidRootPart:FindFirstChildWhichIsA("Motor6D"), tweenInfo, goa)
  222. tween4.Completed:Connect(function()
  223. tween5:Play()
  224. end)
  225. tween5.Completed:Connect(function()
  226. tween6:Play()
  227. end)
  228. local db = false
  229. tool.Activated:Connect(function()
  230. if not db then
  231. db = true
  232. alpha.Transparency = 1
  233. light.Brightness = 0
  234. tween:Play()
  235. twee:Play()
  236. tween2:Play()
  237. tween3:Play()
  238. tween4:Play()
  239. local muzzle = Instance.new("Part",script)
  240. muzzle.CanCollide = false
  241. muzzle.CanQuery = false
  242. muzzle.Anchored = true
  243. s.Parent = muzzle
  244. s.Parent = nil
  245. muzzle.CFrame = part.CFrame * CFrame.new(0,0,-0.8)
  246. muzzle.Position = muzzle.Position + part.Velocity * owner:GetNetworkPing()
  247. muzzle.Transparency = 1
  248. local attachment0 = Instance.new("Attachment")
  249. attachment0.Parent = muzzle
  250. local attachment1 = Instance.new("Attachment")
  251. attachment1.Parent = workspace.Terrain
  252. attachment1.WorldCFrame = attachment0.WorldCFrame
  253. local params = RaycastParams.new()
  254. params.FilterDescendantsInstances = {owner.Character,script,ignorelist}
  255. params.FilterType = Enum.RaycastFilterType.Blacklist
  256. local res = workspace:Raycast(owner.Character.Head.Position,owner.Character.Head.CFrame.lookVector * 5000, params)
  257. local beam = Instance.new("Beam")
  258. beam.Width0 = 0.25
  259. beam.Width1 = 0.2
  260. local p = nil
  261. if res then
  262. p = CFrame.new(res.Position)
  263. else
  264. p = owner.Character.Head.CFrame * CFrame.new(0,0,-7000)
  265. beam.Width1 = 0.125
  266. end
  267. local hitalready = {}
  268. for _, what in pairs(workspace:GetPartBoundsInBox(muzzle.CFrame:Lerp(p,0.5) * CFrame.Angles(muzzle.CFrame:Lerp(p,0.5):Inverse():ToEulerAnglesXYZ()) * CFrame.Angles(CFrame.new(muzzle.Position,p.Position):ToEulerAnglesXYZ()), Vector3.new(0.005,0.005,(p.Position - (muzzle.Position + muzzle.Velocity * owner:GetNetworkPing())).Magnitude))) do
  269. if what:FindFirstAncestorWhichIsA("Model") and what:FindFirstAncestorWhichIsA("Model"):FindFirstChild("Humanoid") and not table.find(hitalready,what) and what:FindFirstAncestorWhichIsA("Model") ~= owner.Character then
  270. what:FindFirstAncestorWhichIsA("Model"):FindFirstChild("Humanoid").Health -= 180
  271. table.insert(hitalready,what)
  272. end
  273. end
  274. beam.Attachment0 = attachment0
  275. beam.Attachment1 = attachment1
  276. beam.CurveSize0 = 0
  277. beam.CurveSize1 = 0
  278. beam.FaceCamera = true
  279. beam.LightInfluence = 0
  280. beam.Segments = 10
  281. beam.LightEmission = 1
  282. beam.Brightness = 0.8
  283. beam.Color = ColorSequence.new{ColorSequenceKeypoint.new(0, Color3.fromRGB(16, 207, 232)),ColorSequenceKeypoint.new(1, Color3.fromRGB(12, 218, 245))}
  284. beam.Transparency = NumberSequence.new{NumberSequenceKeypoint.new(0, 0.9),NumberSequenceKeypoint.new(1, 0.9)}
  285. local gg = {}
  286. gg.WorldCFrame = p
  287. local tweenInfoo = TweenInfo.new(0.08,Enum.EasingStyle.Sine,Enum.EasingDirection.Out)
  288. local tttt = tweenService:Create(attachment1, tweenInfoo, gg)
  289. tttt:Play()
  290. local g = {}
  291. g.Width0 = 0.1
  292. g.Width1 = 0.1
  293. g.Brightness = 0.2
  294. local tweenInfo = TweenInfo.new(0.3,Enum.EasingStyle.Sine,Enum.EasingDirection.Out)
  295. local t = tweenService:Create(beam, tweenInfo, g)
  296. coroutine.wrap(function()
  297. ctime = 0
  298. duration = 0.12
  299. local rot = false
  300. tasefunc = game:GetService("RunService").Stepped:Connect(function(_, delta)
  301. rot = not rot
  302. if rot then
  303. local r = math.random(-20,20)/30
  304. beam.CurveSize0 = r
  305. beam.CurveSize1 = -r
  306. end
  307. ctime = ctime + delta
  308. if ctime > duration then
  309. tasefunc:Disconnect()
  310. end
  311. end)
  312. end)()
  313. coroutine.wrap(function()
  314. for i = -1,100,1 do
  315. wait(0.001)
  316. beam.Transparency = NumberSequence.new{NumberSequenceKeypoint.new(0, (0.072 * i)),NumberSequenceKeypoint.new(1, (0.072 * i))}
  317. end
  318. end)()
  319. beam.Parent = muzzle
  320. coroutine.wrap(function()
  321. wait(0.1)
  322. t:Play()
  323. game:GetService("Debris"):AddItem(muzzle,0.3)
  324. wait(0.4)
  325. local ii = 0
  326. for i = 0.8, 0, -0.1 do
  327. ii = ii + 0.125
  328. alpha.Transparency = i
  329. light.Brightness = 15 * ii
  330. wait(0.0625)
  331. end
  332. db = false
  333. end)()
  334. end
  335. end)
  336. local equip = Instance.new("Sound")
  337. equip.PlayOnRemove = true
  338. equip.Volume = 1
  339. equip.SoundId = "rbxassetid://6870002623"
  340. tool.Equipped:Connect(function()
  341. equip.Parent = part
  342. equip.Parent = nil
  343. end)
  344. tool.Equipped:Connect(function()
  345. armw.Enabled = true
  346. hed.Enabled = true
  347. end)
  348. tool.Unequipped:Connect(function()
  349. armw.Enabled = false
  350. hed.Enabled = false
  351. end)
  352. e.OnServerEvent:Connect(function(_,cam,c1,alpha,hitcf,sw,wcs,shift)
  353. local lookvector = owner.Character.HumanoidRootPart.CFrame:toObjectSpace(cam).lookVector.unit
  354. hed.C0 = hed.C0:Lerp(CFrame.new(0,-0.5,0) * CFrame.Angles(-lookvector.y,0,0),0.5)
  355. hed.C0 = hed.C0 * CFrame.Angles(sw.y,0,0)
  356. if shift then
  357. if lookvector.y > 0 then
  358. armw.C1 = armw.C1:Lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(lookvector.y + sw.y,-(sw.x),0) * CFrame.new(0,0,-0.5 * lookvector.y),0.5)
  359. armw.C1 = armw.C1:Lerp(armw.C1 * CFrame.new(wcs.y / 2, wcs.x / 2,0),0.25)
  360. else
  361. armw.C1 = armw.C1:Lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(lookvector.y + sw.y,-(sw.x),0) * CFrame.new(0,0,-1.5 * lookvector.y),0.5)
  362. armw.C1 = armw.C1:Lerp(armw.C1 * CFrame.new(wcs.y / 2, wcs.x / 2,0),0.25)
  363. end
  364. else
  365. if lookvector.y > 0 then
  366. armw.C1 = armw.C1:Lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(lookvector.y + sw.y,0,0) * CFrame.new(0,0,-0.5 * lookvector.y),0.5)
  367. armw.C1 = armw.C1:Lerp(armw.C1 * CFrame.new(wcs.y / 2, wcs.x / 2,0),0.25)
  368. else
  369. armw.C1 = armw.C1:Lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(lookvector.y + sw.y,0,0) * CFrame.new(0,0,-1.5 * lookvector.y),0.5)
  370. armw.C1 = armw.C1:Lerp(armw.C1 * CFrame.new(wcs.y / 2, wcs.x / 2,0),0.25)
  371. end
  372. end
  373. end)
  374. NLS([[
  375. e = script.Parent
  376. local tool = owner.Backpack:WaitForChild("railgu")
  377. eq = false
  378. tool.Equipped:Connect(function()
  379. eq = true
  380. end)
  381. tool.Unequipped:Connect(function()
  382. eq = false
  383. end)
  384. local ITERATIONS = 8
  385. local SPRING = {}
  386. function SPRING.create(self, mass, force, damping, speed)
  387. local spring = {
  388. Target = Vector3.new();
  389. Position = Vector3.new();
  390. Velocity = Vector3.new();
  391. Mass = mass or 5;
  392. Force = force or 50;
  393. Damping = damping or 4;
  394. Speed = speed or 4;
  395. }
  396. function spring.shove(self, force)
  397. local x, y, z = force.X, force.Y, force.Z
  398. if x ~= x or x == math.huge or x == -math.huge then
  399. x = 0
  400. end
  401. if y ~= y or y == math.huge or y == -math.huge then
  402. y = 0
  403. end
  404. if z ~= z or z == math.huge or z == -math.huge then
  405. z = 0
  406. end
  407. self.Velocity = self.Velocity + Vector3.new(x, y, z)
  408. end
  409. function spring.update(self, dt)
  410. local scaledDeltaTime = math.min(dt,1) * self.Speed / ITERATIONS
  411. for i = 1, ITERATIONS do
  412. local iterationForce = self.Target - self.Position
  413. local acceleration = (iterationForce * self.Force) / self.Mass
  414. acceleration = acceleration - (self.Velocity * self.Damping)
  415. self.Velocity = self.Velocity + (acceleration * scaledDeltaTime)
  416. self.Position = self.Position + (self.Velocity * scaledDeltaTime)
  417. end
  418. return self.Position
  419. end
  420. return spring
  421. end
  422. local wc = SPRING.create()
  423. local sway = SPRING.create()
  424. local bobspeed = 1
  425. local bobmod = .1
  426. local alpha = .25
  427. local hitcf = CFrame.new()
  428. local function gb(addition, speed, modifier)
  429. return math.sin(tick() * addition * speed) * modifier
  430. end
  431. c1 = CFrame.new(0,0,0)
  432. c2 = CFrame.new(0,0,0)
  433. local UIS = game:GetService("UserInputService")
  434. shift = false
  435. UIS:GetPropertyChangedSignal("MouseBehavior"):Connect(function()
  436. if UIS.MouseBehavior == Enum.MouseBehavior.LockCenter then
  437. shift = true
  438. elseif UIS.MouseBehavior ~= Enum.MouseBehavior.LockCenter then
  439. shift = false
  440. end
  441. end)
  442. game:GetService("RunService").RenderStepped:Connect(function(dt)
  443. if eq then
  444. delta = game:GetService("UserInputService"):GetMouseDelta()
  445. local vel = owner.Character.HumanoidRootPart.Velocity
  446. local msway = Vector3.new(gb(10, bobspeed, bobmod), gb(5, bobspeed, bobmod), gb(5, bobspeed, bobmod))
  447. sway:shove(Vector3.new(delta.X / 500, delta.Y / 500))
  448. wc:shove((msway / 25) * dt * 60 * math.clamp(vel.Magnitude,0,30))
  449. local sw = sway:update(dt)
  450. local wcs = wc:update(dt)
  451. e:FireServer(workspace.CurrentCamera.CFrame,c1,alpha,hitcf,sw,wcs,shift)
  452. end
  453. end)
  454. ]],e)
Add Comment
Please, Sign In to add comment