Increasing max speed of sedan car?
car.motorForceConstant = 300f; Thank you ! 300 is the default value ? And where I can enter that ? In the console ?Zugzwangcar.motorForceConstant = 300f;
private void OnEntitySpawned(BaseNetworkable entity)
{
if (entity is BaseCar)
(entity as BaseCar).motorForceConstant = 300f;
}Above code should double the speed of any car that gets spawned. Default is 150.
I'm sorry for necroposting (or whatever the term is), but I was wondering if this is still the case as I haven't been able to get it working sadly :(
The old 'test sedan' was changed when they added modular cars. Now it's called a 'BasicCar'. Try this:
private void OnEntitySpawned(BasicCar entity)
{
entity.motorForceConstant = 300f;
} I have tried to get this working on my server, what am I doing wrong, and why isnt this working. Also what are the limits? Thanks for your help.
Plugin File name saved : CarSpeed.cs
Plugin code:
using Oxide.Core.Plugins;
using UnityEngine;
namespace Oxide.Plugins
{
[Info("CarSpeed", "Name", "1.0.0")]
public class CarSpeed : CovalencePlugin
{
private void OnEntitySpawned(BasicCar entity)
{
entity.motorForceConstant = 300f;
}
}
}