Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.


Dark Dreams of Furiae - a new module for NWN:EE! Buy now
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!


birdman076birdman076 Member Posts: 27
edited March 2019 in Builders - Scripting
Been a long time and i'm trying to get back into the swing of things but hitting a wall. I turned to the script generator but it just doesn't seem to be working. I want to check for an item on the PC, if they don't have it then a random chance of teleporting them to a pocket dimension. This is for an on enter script, what am I missing?

string sSayThis;
int iTalkVolume = TALKVOLUME_TALK;
int iTalkFlag = 0;

void ClearAndJumpToObject(object oDestination);
void ClearAndJumpToObject(object oDestination)

void main()
effect eVFX;
object oTarget;

// Get the creature who triggered this event.
object oPC = GetEnteringObject();

// Only fire for (real) PCs.
if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) )

// Abort if the PC has the item "IT_Pocket_Token".
if ( GetItemPossessedBy(oPC, "IT_Pocket_Token") != OBJECT_INVALID )

// Decide what to do based on a die roll.
switch ( d100() )
case 2:
// Send a message to the player's chat window.
SendMessageToPC(oPC, "You suddenly feel very strange...");

// Find the location to which to teleport.
oTarget = GetWaypointByTag("WP_Pocket_Dimension");

// Teleport the PC.
eVFX = EffectVisualEffect(VFX_IMP_UNSUMMON);
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oPC));
DelayCommand(4.0, AssignCommand(oPC, ClearAndJumpToObject(oTarget)));


Post edited by birdman076 on


Sign In or Register to comment.