Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local PhysicsService = game:GetService("PhysicsService")
- local PlayerGroup = PhysicsService:CreateCollisionGroup("p")
- PhysicsService:CollisionGroupSetCollidable("p","p",false)
- function NoCollision(Model)
- for k,v in pairs(Model:GetChildren()) do
- if v:IsA("BasePart") then
- PhysicsService:SetPartCollisionGroup(v,"p")
- end
- end
- end
- game:GetService("Workspace").ChildAdded:Connect(function(Child)
- if Child and Child:FindFirstChild("HumanoidRootPart") then
- NoCollision(Child)
- end
- end)
- players = game:GetService('Players')
- players.PlayerAdded:Connect(function(plr)
- plr.CharacterAdded:Connect(function(character)
- repeat
- task.wait()
- until character.PrimaryPart
- character.Archivable = true
- local clonedCharacter = character:Clone()
- local clonedHumanoid = clonedCharacter.Humanoid
- clonedHumanoid.WalkSpeed = 22
- clonedCharacter.Parent = workspace
- for i, v in next, clonedCharacter:GetChildren() do
- if v:IsA('BasePart') then
- v.CanCollide = false
- end
- end
- plr.CharacterRemoving:Connect(function()
- clonedCharacter:Destroy()
- end)
- while task.wait((clonedHumanoid.WalkSpeed + (math.round(clonedHumanoid.WalkSpeed/character.Humanoid.WalkSpeed)) + 1) / (clonedHumanoid.WalkSpeed) / 1.5) do
- clonedHumanoid:ChangeState('Running')
- if (clonedCharacter.Humanoid.RootPart.Position - character.Humanoid.RootPart.Position).Magnitude > (clonedHumanoid.WalkSpeed / character.Humanoid.WalkSpeed) * (character.Humanoid.WalkSpeed) then
- task.spawn(function()
- for i = 0, 20 do
- character.Humanoid.RootPart.CFrame = CFrame.new(clonedCharacter.Humanoid.RootPart.Position)
- task.wait()
- end
- character.Humanoid.RootPart:SetNetworkOwner(nil)
- task.wait(2.5)
- character.Humanoid.RootPart:SetNetworkOwner(plr)
- end)
- end
- clonedHumanoid.RootPart.CFrame = CFrame.new(character.Humanoid.RootPart.Position)
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement