Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local remote = game.ReplicatedStorage.Remotes.Stands.StandRemote
- local standModule = require(game.ServerStorage.ServerModules.StandModule)
- local punchModule = require(game.ReplicatedStorage.Modules.PunchModule)
- local TweenService = game:GetService("TweenService")
- local timeStopTweenInfo = TweenInfo.new(2)
- local timeStopTween = TweenService:Create(game.Lighting.ColorCorrection, timeStopTweenInfo, { Saturation = -1 })
- local timeResumeTween = TweenService:Create(game.Lighting.ColorCorrection, timeStopTweenInfo, { Saturation = 0 })
- local isHit = false
- local function ShootProjectile(plr, char, offset)
- local projectile
- if char:GetAttribute("Stand") == "Star Platinum" then
- projectile = game.ReplicatedStorage.Assets.Stands.Bearing:Clone()
- else
- projectile = game.ReplicatedStorage.Assets.Stands.Knife:Clone()
- end
- projectile.CFrame = char.HumanoidRootPart.CFrame * offset
- projectile.Parent = workspace
- task.delay(20, function()
- if projectile then
- projectile:Destroy()
- isHit = false
- end
- end)
- projectile.Destroying:Connect(function()
- isHit = false
- end)
- projectile.Touched:Connect(function(hit)
- if not hit then return end
- if hit.Parent:FindFirstChild("HumanoidRootPart") then
- if hit.Parent:FindFirstChild("Dummy") then
- if isHit then return end
- isHit = true
- hit.Parent.Humanoid:TakeDamage(2)
- projectile:Destroy()
- return
- end
- if game.Players:GetPlayerFromCharacter(hit.Parent).Name == plr.Name then return end
- if isHit then return end
- isHit = true
- hit.Parent.Humanoid:TakeDamage(2)
- end
- if hit.Parent.Name ~= plr.Name then
- if not hit.Parent:IsA("Model") then return end
- if hit.Name == plr.Name then return end
- if hit.Name == "Baseplate" or hit.Name == "SpawnLocation" then return end
- if game.ReplicatedStorage.Assets:FindFirstChild(hit.Name, true) then return end
- projectile:Destroy()
- end
- end)
- local bv = Instance.new("BodyVelocity")
- bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
- bv.Velocity = char.HumanoidRootPart.CFrame.LookVector * 30
- bv.Parent = projectile
- end
- remote.OnServerEvent:Connect(function(plr, state, move)
- if not move then move = "Behind" end
- local char = plr.Character
- if state == "summon" then
- standModule.Summon(char, game.ServerStorage.Stands[char:GetAttribute("Stand")]:Clone())
- elseif state == "desummon" then
- standModule.DeSummon(char)
- elseif state == "move" then
- standModule.Move(char.HumanoidRootPart.Weld, move)
- elseif state == "road" then
- local road = game.ReplicatedStorage.Assets["Road Roller"]:Clone()
- road.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0, 80, 0)
- road.Parent = workspace
- road.Touched:Connect(function(hit)
- if hit:FindFirstChild("Humanoid", true) then
- hit.Humanoid.Health = 0
- end
- end)
- task.delay(10, function()
- road:Destroy()
- end)
- elseif state == "projectile" then
- ShootProjectile(plr, char, CFrame.new(0, 0.5, -1))
- ShootProjectile(plr, char, CFrame.new(0.2, 0.5, -1))
- ShootProjectile(plr, char, CFrame.new(-0.2, 0.5, -1))
- elseif state == "timestop" then
- local sound = game.SoundService.Stands.TimeStop
- sound:Play()
- timeStopTween:Play()
- for i,v: Part in workspace:GetChildren() do
- if v:FindFirstChild("HumanoidRootPart", true) then
- if v:FindFirstChild("HumanoidRootPart", true).Parent.Name == plr.Name then continue end
- if v:FindFirstChild("Stand", true) then
- if v:FindFirstChild("Stand", true).Value == "Star Platinum" or v:FindFirstChild("Stand", true).Value == "The World" then
- task.delay(2, function()
- local char = v:FindFirstChild("HumanoidRootPart", true).Parent
- char:SetAttribute("State", "Stunned")
- end)
- end
- else
- local char = v:FindFirstChild("HumanoidRootPart", true).Parent
- char:SetAttribute("State", "Stunned")
- end
- end
- end
- game.ServerStorage.TimeStopperName.Value = plr.Name
- game.ServerStorage.IsTimeStopped.Value = true
- task.wait(10)
- game.ServerStorage.IsTimeStopped.Value = false
- game.ServerStorage.TimeStopperName.Value = ""
- local sound2 = game.SoundService.Stands.TimeResume
- sound2:Play()
- timeResumeTween:Play()
- sound2.Ended:Connect(function()
- for i,v: Part in workspace:GetChildren() do
- if v:FindFirstChild("BodyVelocity", true) then
- v.Anchored = false
- end
- if v:FindFirstChild("HumanoidRootPart", true) then
- local char = v:FindFirstChild("HumanoidRootPart", true).Parent
- char:SetAttribute("State", "Default")
- if char:FindFirstChild("IsRagdoll") and char.IsRagdoll.Value and char.Humanoid.Health > 0 then
- task.delay(2, function()
- char.IsRagdoll.Value = false
- end)
- end
- end
- end
- end)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement