I noticed there are no individual threads which have useful/fun .lua commands in one place, so heres a few I figured out (mostly with help from the people here at Gametoast)
This topic would be beneficial to those getting familiar with .lua functions
Feel free to share other useful commands
Main Chunk: Kill object
Code: Select all
OnObjectKill(
function(object, killer)
if GetEntityName(object) == "OBJECTNAME" then
-- put goodies here
end
end
)Code: Select all
OnEnterRegion(
function(regIn,character)
-- put goodies here
end,
"REGIONNAME"
)Kill an object:
Code: Select all
KillObject("OBJECTNAME")Code: Select all
RespawnObject("OBJECTNAME") Code: Select all
MoveEntityToNode(character,"PATHNAME")Code: Select all
PauseAnimation("ANIMGROUPNAME")
RewindAnimation("ANIMGROUPNAME")
PlayAnimation("ANIMGROUPNAME")Code: Select all
ActivateRegion("REGIONNAME")Code: Select all
DeactivateRegion("REGIONNAME")Code: Select all
SetProperty("OBJECTTHATISADOOR", "IsLocked", 1)Code: Select all
AddAssaultDestroyPoints(character)
EDIT: All these commands go in the "ScriptPostLoad" section





