Treasure chest spawning in backwards?
Knight_Shield
Member Posts: 51
So basically I'm trying to get chest to face away from monster.
My existing script:
I'm trying to blend this with it but just can't make it happen ...
My existing script:
void main() { object oPC = GetLastKiller(); if (!GetIsPC(oPC)) return; if (d100()<=10) { object oPC; object oTarget; object oSpawn; location lTarget; oTarget = OBJECT_SELF; lTarget = GetLocation(oTarget); oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "tres_anylow002", lTarget); DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_DISPEL), oSpawn)); FloatingTextStringOnCreature("You found loot!", oPC); } }
I'm trying to blend this with it but just can't make it happen ...
location lSpawnLoc = Location(GetArea(OBJECT_SELF), GetPosition(OBJECT_SELF), GetFacing(OBJECT_SELF)-180.0); CreateObject(OBJECT_TYPE_PLACEABLE, "treasure_chest_resref_here", lSpawnLoc);
0
Comments
TR
(I've never tried to use modulus arithmetic with floats before so I'm not certain it will work even though it should work in theory).
Edit: And now I see there's a function to do exactly what I showed you.