-- this script was created in order to stop player from being slippery because the A-Chassis car they were driving was regenerated without them hopping off first


local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharactedAdded:wait()
local Humanoid = Character:WaitForChild("Humanoid")
local SeatSpeed = 16
local SaveSpeed
local seated

Humanoid.Seated:Connect(function()
	if seated then
		Humanoid.WalkSpeed = SaveSpeed
		seated = false
		
		-- stop player from being slippery
		for i, part in ipairs(Character:GetChildren()) do
			if part:IsA("Part") then
				part.CustomPhysicalProperties = PhysicalProperties.new(Enum.Material.Plastic)
			end
		end
		
	else
		SaveSpeed = Humanoid.WalkSpeed
		Humanoid.WalkSpeed = SeatSpeed
		seated = true
	end
end)
