local Assets = LoadAssets(15984864764)
local folderofcrap = Instance.new("Folder")
table.foreach(Assets:Get("Dodge"):GetChildren(), function(i,v)
local lol = v:Clone()
lol.Parent = folderofcrap
end)
local lol = folderofcrap.dodge
if lol.Body.VehicleSeat:FindFirstChild("WeldConstraint") then
lol.Body.VehicleSeat:FindFirstChild("WeldConstraint"):Remove()
end
lol.Parent = workspace
lol.Name = game:GetService("HttpService"):GenerateGUID(false).."_IAMADODGECHALLENGER (I AM IN FACT A DODGE CHALLENGER) "..owner.UserId
script.Parent = lol
local car = script.Parent
local seat = car.Body.VehicleSeat
local body = car.Body.Body
local plat = car.Chassis.Platform
seat.CFrame = seat.CFrame * CFrame.new(0,-1.85,0)
local eieie = Instance.new("WeldConstraint",seat)
eieie.Part0 = seat
eieie.Part1 = body
seat.Transparency = 1
task.delay(.25,function()
car:SetPrimaryPartCFrame(owner.Character.HumanoidRootPart.CFrame*CFrame.new(20,2.5,0))
end)
local client = Instance.new("Folder")
local carVal = Instance.new("ObjectValue",client)
carVal.Name = "Car"
carVal.Value = car
local stopVal = Instance.new("BoolValue",client)
stopVal.Name = "Stop"
stopVal.Value = false
local physicsService = game:GetService("PhysicsService")
local occupiedPlayer = nil
local occupiedPlayerScript = nil
local charCollisionGroup = "Character"
local bodyCollisionGroup = "CarBody"
local wheelCollisionGroup = "CarWheel"
physicsService:RegisterCollisionGroup(charCollisionGroup)
physicsService:RegisterCollisionGroup(bodyCollisionGroup)
physicsService:RegisterCollisionGroup(wheelCollisionGroup)
physicsService:CollisionGroupSetCollidable(bodyCollisionGroup, wheelCollisionGroup, false)
physicsService:CollisionGroupSetCollidable(bodyCollisionGroup, charCollisionGroup, false)
physicsService:CollisionGroupSetCollidable(wheelCollisionGroup, charCollisionGroup, false)
local cooldown = 0
local music = body.Music
music.SoundId = "rbxassetid://98996581505455"
music.PlaybackSpeed = (1/.6)
music.Volume = 15
function Cooldown(v)
local cooltick = tick()
cooldown = cooltick
task.delay(v,function()
if cooldown == cooltick then
cooldown = 0
end
end)
end
local function ApplyAnim(char,doit)
if char:FindFirstChildOfClass("Humanoid").RigType == "R15" then
return
end
if doit then
local torso = char:FindFirstChild("Torso")
torso["Left Shoulder"].C0 = CFrame.new(-1, 0.5, -0.15)*CFrame.Angles(math.rad(20),math.rad(-110),math.rad(20))
torso["Right Shoulder"].C0 = CFrame.new(1, 0.5, 0)*CFrame.Angles(math.rad(30),math.rad(50),math.rad(-50))
else
local torso = char:FindFirstChild("Torso")
torso["Left Shoulder"].C0 = CFrame.new(-1, 0.5, 0)*CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0))
torso["Right Shoulder"].C0 = CFrame.new(1, 0.5, 0)*CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
end
end
local function modifyCharacterCollisions(character, collide)
for i,v in pairs(character:GetDescendants()) do
if v:IsA("BasePart") then
v.Massless = not collide
v.CollisionGroup = (not collide and charCollisionGroup or "Default")
end
end
end
local function changeColor(color : Color3)
local color = color or Color3.new(0.666667, 0.666667, 1)
table.foreach(car["Non-Essential"].MainBody:GetChildren(),function(i,v)
if v.Name == "COLOR" then
game:GetService("TweenService"):Create(v,TweenInfo.new(1),{Color = color}):Play()
end
end)
end
local function OccupantChanged()
if seat.Occupant then return end
if occupiedPlayer.Character then
ApplyAnim(occupiedPlayer.Character,false)
modifyCharacterCollisions(occupiedPlayer.Character, true)
end
if occupiedPlayerScript.Parent then
occupiedPlayerScript.Stop.Value = true
local cli = occupiedPlayerScript
task.delay(1,function()
cli:Remove()
end)
end
car.PrimaryPart:SetNetworkOwnershipAuto()
changeColor(Color3.new(.25,.25,.25))
occupiedPlayerScript = nil
occupiedPlayer = nil
body.Music:Stop()
Cooldown(3)
end
local function BodyTouched(part)
if cooldown ~= 0 then return end
if seat.Occupant then return end
local chara = part.Parent
local player = game:GetService("Players"):GetPlayerFromCharacter(chara)
if not player then return end
local hum = chara:FindFirstChildOfClass("Humanoid")
if not hum then return end
occupiedPlayer = player
occupiedPlayerScript = NLS([[
local car = script:WaitForChild("Car").Value
local stop = script:WaitForChild("Stop")
local runService = game:GetService("RunService")
local hbEvent
local mouse
local seat = car.Body.VehicleSeat
local attFL = car.Chassis.Platform.AttachmentFL
local attFR = car.Chassis.Platform.AttachmentFR
local plat = car.Chassis.Platform
local cylFL = plat.CylindricalFL
local cylFR = plat.CylindricalFR
local cylRL = plat.CylindricalRL
local cylRR = plat.CylindricalRR
local maxSteerAngle = 30
local steer = 0
local throttle = 0
local function Update(deltaTime)
-- steering
local steerGoal = -seat.SteerFloat * maxSteerAngle
steer = steer + (steerGoal - steer) * math.min(deltaTime * seat.TurnSpeed,1)
attFL.Orientation = Vector3.new(0, steer, -90)
attFR.Orientation = Vector3.new(0, steer, -90)
-- throttle
local throttleGoal = seat.ThrottleFloat
throttle = throttle + (throttleGoal - throttle) * (deltaTime * seat.TurnSpeed)
local torque = seat.Torque
local speed = seat.MaxSpeed * throttle
cylFL.MotorMaxTorque = torque
cylFR.MotorMaxTorque = torque
cylRL.MotorMaxTorque = torque
cylRR.MotorMaxTorque = torque
cylFL.AngularVelocity = speed
cylFR.AngularVelocity = -speed
cylRL.AngularVelocity = speed
cylRR.AngularVelocity = -speed
end
local function Start()
warn("Client started.")
hbEvent = runService.Heartbeat:Connect(Update)
mouse = game:GetService("Players").LocalPlayer:GetMouse().KeyDown:Connect(function(v)
if v == "v" then
plat.CFrame = CFrame.new(plat.Position) * CFrame.new(0,15,0)
end
end)
end
local function Stop()
warn("Client stopped.")
hbEvent:Disconnect()
mouse:Disconnect()
script:Remove()
end
Start()
if stop.Value == true then Stop() return end
stop.Changed:Connect(function(stop)
if not stop then return end
Stop()
end)
]],player.Backpack)
table.foreach(client:GetChildren(),function(i,v)
v:Clone().Parent = occupiedPlayerScript
end)
modifyCharacterCollisions(chara, false)
ApplyAnim(chara,true)
seat:Sit(hum)
changeColor(BrickColor.Random().Color)
car.PrimaryPart:SetNetworkOwner(player)
body.Music:Play()
Cooldown(5)
end
body.Touched:Connect(BodyTouched)
seat:GetPropertyChangedSignal("Occupant"):Connect(OccupantChanged)
owner.Chatted:Connect(function(v)
if not occupiedPlayer then return end
if v:sub(1,6) == "-play " then
local id = v:sub(7)
music.SoundId = "rbxassetid://"..id
music:Play()
elseif v:sub(1,7) == "-pitch " then
local id = v:sub(8)
music.PlaybackSpeed = id
end
end)