Please keep in mind EraScript is currently in Beta.
How to use EraScript?
Open %LOCALAPPDATA%, make a directory called "ProjectEra" and put your code in a file named execute.js
,
when in-game, open the console (using ~
) and type cheatscript execute
to execute the code.
What language does EraScript use?
JavaScript running on the Duktape engine.
-
Finds an UObject by name. The second argument decides whether the name has to be exact
UObject* findObject("Object", false)
- Usage:
var object = findObject("BlueprintGeneratedClass HuskPawn");
var object = findObject("BlueprintGeneratedClass HuskPawn.HuskPawn_C", true);
- Usage:
-
Returns the name of an object
String getObjectName(Object)
- Usage:
var object = findObject("FortWeaponRangedItemDefinition WID_Sniper_Crossbow_Athena_R_Ore_T03"); console.log(getObjectName(object)); // FortWeaponRangedItemDefinition WID_Sniper_Crossbow_Athena_R_Ore_T03.WID_Sniper_Crossbow_Athena_R_Ore_T03
- Usage:
-
Returns the location of an Actor
FVector getLocation(Actor)
- Usage:
console.log(getLocation(getLocalPlayer())); // {X:-124119.125,Y:-116151.125,Z:3917.18408203125}
- Usage:
-
Spawns an Actor
spawnActor(Object, FVector)
- Usage:
var object = findObject("BlueprintGeneratedClass HuskPawn"); spawnActor(object, new FVector(0, 0, 0));
- Usage:
-
Destroys an Actor
destroyActor(Actor)
- Usage:
var object = findObject("BlueprintGeneratedClass HuskPawn"); var husk = spawnActor(object, new FVector(0, 0, 0)); messageBox("Press OK to destroy the husk."); destroyActor(husk);
- Usage:
-
Finds all/one Actor of a class
Array<UObject*> findActorsOfClass(Object) UObject* findActorsOfClass(Object, 0)
- Usage:
var object = findObject("BlueprintGeneratedClass HuskPawn"); spawnActor(object, new FVector(0, 0, 0)); console.log(findActorsOfClass(object));
- Usage:
-
Executes a console command
executeConsoleCommand("command")
- Usage:
executeConsoleCommand("demospeed 2");
- Usage:
-
Teleports an Actor
teleport(Actor, FVector)
- Usage:
teleport(getLocalPlayer(), new FVector(0, 0, 0));
- Usage:
-
Shows a message box
messageBox("Message")
- Usage:
messageBox("Hello, World!")
- Usage:
-
Plays a sound
playSound(Sound, FVector, Volume, Pitch)
- Usage:
var sound = findObject("SoundCue airstrike_incoming_place_Cue"); playSound(sound, getLocation(getLocalPlayer()), 1 ,1);
- Usage:
-
spawnPickup(Object, FVector, 1)
-
grantAbility(Object)
-
addToInventory(Object, 1)
-
bool isInVehicle()
-
UObject* getVehicle()
-
setScaleActor(Actor, FVector)
-
UObject* getLocalPlayer()
-
FVector
new FVector(0, 0, 0)
-
FRotator
new FRotator(0, 0, 0)
-
TArray
Only used in the global variables. Only reading the TArrays is allowed currently
-
T TArray.get(1)
Returns the TArray item at the index or all of the items if no arguments are passed.Array<T> TArray.get()
-
Returns the length of the TArray
TArray.length
-
- TArray ammoItemCount
- TArray<UObject*> ammoItemDefs
- TArray consumablesItemCount
- TArray<UObject*> consumablesItemDefs
- TArray resourceItemCount
- TArray<UObject*> resourceItemDefs
- TArray trapsItemCount
- TArray<UObject*> trapsItemDefs
- TArray weaponItemCount
- TArray<UObject*> weaponItemDefs
- TArray resourceItemCount
- TArray<UObject*> resourceItemDefs
- String fortniteVersion