Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Get credits

Page: 1 of 1
 Mindtwistah
06-10-2007, 2:17 PM
#1
What is the script to get credits?

I was thinking this:

Giveitem ("credits", "2000")

But I don't think that would work.
 Gargoyle King
06-10-2007, 2:22 PM
#2
What is the script to get credits?

I was thinking this:

Giveitem ("credits", "2000")

But I don't think that would work.

I'm quite a noob when it comes to modding, but i believe it is this:

To get credits:
GiveGoldToCreature( GetFirstPC(),nAmount);

To take credits away:
TakeGoldFromCreature( GetFirstPC(),nAmount);

- i think after the n, instead of "Amount" you put in the value for the credits.

Hope this helps! (if it's correct :lol: )
 Master Zionosis
06-10-2007, 2:27 PM
#3
A script like this would work, obviously "gold" is credits, lol:

void main() {
int nGoldPieces = (500);
object oNPC=GetObjectByTag("your_npc_tag");
GiveGoldToCreature(oNPC, nGoldPieces);
}

Replace 500 with the number of credits you want to be given to you, and replace "your_npc_tag" with the tag of the NPC thats giving you the credits. ;)
 Mindtwistah
06-10-2007, 2:35 PM
#4
If I put it in a dialog file where for example Bastila is giving me credits, do I have to put in this?
object oNPC=GetObjectByTag("your_npc_tag");
 stoffe
06-10-2007, 3:10 PM
#5
If I put it in a dialog file where for example Bastila is giving me credits, do I have to put in this?
object oNPC=GetObjectByTag("your_npc_tag");

No, if you give the credits to GetFirstPC() they will be added to the player/party credit account. This should be enough:


void main() {
GiveGoldToCreature(GetFirstPC(), 1000);
}

...where you replace 1000 with how many credits you want to give.
 Mindtwistah
06-10-2007, 3:29 PM
#6
Thanks to all of you for your help. I will probably use Stoffes scripts since it is the smallest one.
Page: 1 of 1