Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // create some entity
- local hEntity = Entities.CreateByClassname("info_target");
- // create its script scope
- local tEntityScope = hEntity.GetOrCreatePrivateScriptScope();
- tEntityScope.MoveUp <- function (fUnits)
- {
- // When this function executes, we're within the entity's script scope.
- local vOrigin = self.GetOrigin();
- vOrigin.y = vOrigin.y + fUnits;
- self.SetOrigin(vOrigin);
- }
- // vOrigin no longer exists here, because it's local to the bracket above
- // However, tEntityScope still exists
- tEntityScope.MoveUp(10.0);
Advertisement
Add Comment
Please, Sign In to add comment