i am posting a script for a rpg game maker if you have any bug please report them i currently have made the script for a npc to give the quest and end a quest and give a reward for it the reward is given by creating it in front of the npc an dyou pick it up from an inventory sytem sorry no inventory included. i am alos currently creating a script fro the player to be given the quest and allow it to retreve the objective item it should eb done soon but heres the npc script
var forceball : Transform;
var speech : AudioClip;
var objectToGather : Transform;
var questGUI : GUI;
var speechFinish : AudioClip;
//starts the speech for the quest to get the intructions out.
function Start () {
if (Collision(forceball)) {
Start(AudioClip(speech));
instaniate(questGUI);
}
}
//gets the gatthere item and destroys it and plays the sound of person saying thank etc. also plays
//the gui and sound of the finihsed quest.
function Gather () {
if (Collision(objectToGather)) {
Start(AudioClip(speechFinish));
remove (objectToGather);
instantiate(finishedGUI);
Start(AudioClip(questComplete);
Instantiate(Reward);
}
}