Skip to content

Instantly share code, notes, and snippets.

@nickarthur
Last active December 28, 2015 20:19
Show Gist options
  • Save nickarthur/7556808 to your computer and use it in GitHub Desktop.
Save nickarthur/7556808 to your computer and use it in GitHub Desktop.
spawn a teleporter at a detected user's position relative to a game object hosting this script. cloudparty CLOUDPARTY (relative spawning of objects)
function spawnTeleport(entFieldsData) {
error('Got ' + entFieldsData.display_name + '\'s position at ' + stringify(entFieldsData.pos, {newline: false, indent: false}));
vecPosWorldToRel(entFieldsData.pos);
vecAdd(entFieldsData.pos, []);
spawn({
prefab: 'Timeout Prefab',
pos: entFieldsData.pos
});
}
getEntFields({
ent: racer,
fields: ['display_name','pos'],
callback: 'spawnTeleport'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment