'CreateObject' function (EN) - Archie-osu/ProjectDELTA GitHub Wiki
Creates an in-game object on user-specified coordinates.
<RValue> CreateObject(
<string> ObjectName,
<real> XCoord,
<real> YCoord
);ObjectName
Type: String
The name of the object. Examples: obj_mysteryman, obj_gasterblaster.
XCoord
Type: Real Number
The X position (horizontal) of the created object.
YCoord
Type: Real Number
The Y position (vertical) of the created object.
Type: RValue
The instance ID of the created object.
You can use this ID with GameMaker functions like instance_destroy.
local id = CreateObject("obj_savepoint", 340, 230); -- Create an obj_savepoint at { 340, 230 }, and save the instance ID in the "id" variable
print(id.realval); -- Print the real value of the "id" RValue. This is the created instance ID.