Talk:SetCrimeGold - Faction

There are no discussions on this page.

This is my first time commenting on a wiki, so please excuse me if I'm doing this wrong. I created a simple script using this function with the following results:


Scriptname AKcrimetest extends ObjectReference 

faction property akfaction auto
int property akbounty auto

Event OnActivate(ObjectReference akActionRef)

	akbounty = 10

	debug.notification("Haafinger crime="+ akfaction.getcrimegold())

	if akfaction.getcrimegold() >10
		akfaction.setcrimegold(5)
		debug.notification("greater than 10. Setting to 5")

	elseif akfaction.getcrimegold() < 10
		akfaction.setcrimegold(5+ akfaction.getcrimegold())
		debug.notification("Less than 10, adding 5")
	endif

endevent

The script works at 0 bounty, increasing the bounty to 5. It works at 5 bounty, increasing player bounty to 10. At 10 bounty, however, it does nothing. This indicates to me that setcrimegold() only works when it increases the bounty. Does this mean this is a CK bug? (and consequently should be noted on the page?) Either way, is it at all appropriate for me to be posting this here? If not, where should I be posting this?

There is nothing wrong. Check your code. You have a check for when bounty is less than 10, a check for when bounty is greater than 10, but nothing for when bounty equals 10. You wrote your script so that nothing happens when bounty is 10.--Fg109 20:20, 5 May 2012 (EDT)
Doh! How idiotic of me! Bahaha, I spent hours on trying to figure that out! GAH! Thank you!
Return to "SetCrimeGold - Faction" page.