Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- localRootPart = game.Players.LocalPlayer.Character.HumanoidRootPart
- event = game.ReplicatedStorage.Resource.Event
- function getCFrameBehindPart(part)
- local partRotation = part.CFrame:toAxisAngle()
- local bottomOfPart = part.CFrame.p-Vector3.new(0,part.Size.Y/2,0)
- local behindPart = CFrame.new(bottomOfPart-part.CFrame.lookVector*1.2)+Vector3.new(0,1,0)
- return behindPart*CFrame.Angles(partRotation.X,partRotation.Y,partRotation.Z)
- end
- for _,plr in pairs(game.Teams.Criminal:GetPlayers()) do
- local char = plr.Character
- if char ~= nil and char:FindFirstChild("HumanoidRootPart") ~= nil then
- local rootPart = char.HumanoidRootPart
- repeat
- event:FireServer("VehicleExit")
- localRootPart.CFrame = getCFrameBehindPart(rootPart)
- wait()
- for _,veh in pairs(game.Workspace.Vehicles:GetChildren()) do
- event:FireServer("AttemptVehicleEject",veh)
- end
- event:FireServer("AttemptArrest", plr.Name)
- until plr.Team.Name ~= "Criminal" or rootPart == nil
- end
- end
Add Comment
Please, Sign In to add comment