The script is for a secret compartment on a container. This is how it works, player opens container sees junk. If player chooses to leave junk in container nothing happens. If player removes junk from container then script fires. A new item appears in container and a speaker string informs player of secret compartment.
Now if I put the ResRef directly in the code the script fires fine. But if I try to do it using “string sTemplate” nothing happens. …why?
*SCRIPT START*
//Put this script On Inventory Disturbed Script
//Created by Alupinu
void main(string sTemplate)
{
object oPC = GetLastUsedBy();
//if (!GetIsPC(oPC)) return;
int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
if (DoOnce==TRUE) return;
SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
CreateItemOnObject(sTemplate, OBJECT_SELF);
ActionSpeakString("*SUCCESS* You found a secret compartment in the chest.");
}
*SCRIPT ENDS*
Thank you.
Modifié par Alupinu, 02 mai 2012 - 09:03 .





Retour en haut







