Page 1 of 1

"Swap" NPCs on an object

PostPosted: Thu Dec 24, 2020 10:41 pm
by NerfemTudo
I wish to know if it is possible to "change" an NPC on a door.
Here's the deal: I want to have a shop NPC during the day, but during the night change it with a non-shop NPC.
My theory is: Script the object that once used, check the time, if it is during the night, make the player talk to another npc instead of going to the store that will be closed at night, if not "default". :geek:
In theory is easy put everytime i tried, the spaghetti code that i wrote made the Editor explode. :oops:
Help?

Re: "Swap" NPCs on an object

PostPosted: Sun Dec 27, 2020 5:55 pm
by KGold
Set the shopkeeper as the default NPC for the door then put this code on the door:

if(evtuse())
{
if(isNight())
talknpc("NPC id here");
else
default();
}

Re: "Swap" NPCs on an object

PostPosted: Thu Jan 14, 2021 11:39 pm
by NerfemTudo
KGold wrote:Set the shopkeeper as the default NPC for the door then put this code on the door:

if(evtuse())
{
if(isNight())
talknpc("NPC id here");
else
default();
}

Thank you :D