Advertisement
Ultimate_69

Stand Server

Feb 6th, 2025
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.74 KB | None | 0 0
  1. local remote = game.ReplicatedStorage.Remotes.Stands.StandRemote
  2. local standModule = require(game.ServerStorage.ServerModules.StandModule)
  3. local punchModule = require(game.ReplicatedStorage.Modules.PunchModule)
  4.  
  5. local TweenService = game:GetService("TweenService")
  6. local timeStopTweenInfo = TweenInfo.new(2)
  7.  
  8. local timeStopTween = TweenService:Create(game.Lighting.ColorCorrection, timeStopTweenInfo, { Saturation = -1 })
  9. local timeResumeTween = TweenService:Create(game.Lighting.ColorCorrection, timeStopTweenInfo, { Saturation = 0 })
  10.  
  11. local isHit = false
  12.  
  13. local function ShootProjectile(plr, char, offset)
  14. local projectile
  15.  
  16. if char:GetAttribute("Stand") == "Star Platinum" then
  17. projectile = game.ReplicatedStorage.Assets.Stands.Bearing:Clone()
  18. else
  19. projectile = game.ReplicatedStorage.Assets.Stands.Knife:Clone()
  20. end
  21.  
  22. projectile.CFrame = char.HumanoidRootPart.CFrame * offset
  23. projectile.Parent = workspace
  24.  
  25. task.delay(20, function()
  26. if projectile then
  27. projectile:Destroy()
  28. isHit = false
  29. end
  30. end)
  31.  
  32. projectile.Destroying:Connect(function()
  33. isHit = false
  34. end)
  35.  
  36. projectile.Touched:Connect(function(hit)
  37. if not hit then return end
  38. if hit.Parent:FindFirstChild("HumanoidRootPart") then
  39. if hit.Parent:FindFirstChild("Dummy") then
  40. if isHit then return end
  41. isHit = true
  42. hit.Parent.Humanoid:TakeDamage(2)
  43. projectile:Destroy()
  44. return
  45. end
  46. if game.Players:GetPlayerFromCharacter(hit.Parent).Name == plr.Name then return end
  47. if isHit then return end
  48. isHit = true
  49. hit.Parent.Humanoid:TakeDamage(2)
  50. end
  51. if hit.Parent.Name ~= plr.Name then
  52. if not hit.Parent:IsA("Model") then return end
  53. if hit.Name == plr.Name then return end
  54. if hit.Name == "Baseplate" or hit.Name == "SpawnLocation" then return end
  55. if game.ReplicatedStorage.Assets:FindFirstChild(hit.Name, true) then return end
  56. projectile:Destroy()
  57. end
  58. end)
  59.  
  60. local bv = Instance.new("BodyVelocity")
  61. bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  62. bv.Velocity = char.HumanoidRootPart.CFrame.LookVector * 30
  63. bv.Parent = projectile
  64. end
  65.  
  66. remote.OnServerEvent:Connect(function(plr, state, move)
  67. if not move then move = "Behind" end
  68. local char = plr.Character
  69.  
  70. if state == "summon" then
  71. standModule.Summon(char, game.ServerStorage.Stands[char:GetAttribute("Stand")]:Clone())
  72. elseif state == "desummon" then
  73. standModule.DeSummon(char)
  74. elseif state == "move" then
  75. standModule.Move(char.HumanoidRootPart.Weld, move)
  76. elseif state == "road" then
  77. local road = game.ReplicatedStorage.Assets["Road Roller"]:Clone()
  78. road.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0, 80, 0)
  79. road.Parent = workspace
  80.  
  81. road.Touched:Connect(function(hit)
  82. if hit:FindFirstChild("Humanoid", true) then
  83. hit.Humanoid.Health = 0
  84. end
  85. end)
  86.  
  87. task.delay(10, function()
  88. road:Destroy()
  89. end)
  90. elseif state == "projectile" then
  91. ShootProjectile(plr, char, CFrame.new(0, 0.5, -1))
  92. ShootProjectile(plr, char, CFrame.new(0.2, 0.5, -1))
  93. ShootProjectile(plr, char, CFrame.new(-0.2, 0.5, -1))
  94. elseif state == "timestop" then
  95. local sound = game.SoundService.Stands.TimeStop
  96. sound:Play()
  97.  
  98. timeStopTween:Play()
  99.  
  100. for i,v: Part in workspace:GetChildren() do
  101. if v:FindFirstChild("HumanoidRootPart", true) then
  102. if v:FindFirstChild("HumanoidRootPart", true).Parent.Name == plr.Name then continue end
  103. if v:FindFirstChild("Stand", true) then
  104. if v:FindFirstChild("Stand", true).Value == "Star Platinum" or v:FindFirstChild("Stand", true).Value == "The World" then
  105. task.delay(2, function()
  106. local char = v:FindFirstChild("HumanoidRootPart", true).Parent
  107. char:SetAttribute("State", "Stunned")
  108. end)
  109. end
  110. else
  111. local char = v:FindFirstChild("HumanoidRootPart", true).Parent
  112. char:SetAttribute("State", "Stunned")
  113. end
  114. end
  115. end
  116.  
  117. game.ServerStorage.TimeStopperName.Value = plr.Name
  118. game.ServerStorage.IsTimeStopped.Value = true
  119.  
  120. task.wait(10)
  121.  
  122. game.ServerStorage.IsTimeStopped.Value = false
  123. game.ServerStorage.TimeStopperName.Value = ""
  124.  
  125. local sound2 = game.SoundService.Stands.TimeResume
  126. sound2:Play()
  127. timeResumeTween:Play()
  128. sound2.Ended:Connect(function()
  129. for i,v: Part in workspace:GetChildren() do
  130. if v:FindFirstChild("BodyVelocity", true) then
  131. v.Anchored = false
  132. end
  133. if v:FindFirstChild("HumanoidRootPart", true) then
  134. local char = v:FindFirstChild("HumanoidRootPart", true).Parent
  135. char:SetAttribute("State", "Default")
  136.  
  137. if char:FindFirstChild("IsRagdoll") and char.IsRagdoll.Value and char.Humanoid.Health > 0 then
  138. task.delay(2, function()
  139. char.IsRagdoll.Value = false
  140. end)
  141. end
  142. end
  143. end
  144. end)
  145. end
  146. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement