SphereCommunity

Full Version: Rulette is not giving gold
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone!

I'm trying to do a roulette but it's not giving gold cause it has an ERROR at the console caused by NEWGOLD.

The message is telling the correct number, but it's not giving gold

Hope you can help me.

Thanks in advance.



[FUNCTION f_roulette_win]

//Give proper gold

VAR.MULTIPLIER=<ARGS>

//Calc the gold

VAR.NEWGOLD=<ARGS>*<LINK.TAG.WAGER>

VAR.TOTALGOLD=<VAR.NEWGOLD>+<LINK.TAG.WAGER>

//Tell them what they won

LINK.SYSMESSAGE="You recieve <EVAL <VAR.TOTALGOLD>> gold coins!!!"

//Create it and put it in your pack

SRC.NEWGOLD <EVAL <VAR.TOTALGOLD>> (I also tried with <VAR.TOTALGOLD> only, and it's not working)

LINK.ACT.CONT=<LINK.FINDLAYER(21).UID>

//Now create the item that shows the gump

LINK.NEWITEM i_roulette_win

LINK.ACT.CONT=<LINK.UID>

RETURN 1
I tried to solve it by creating the function "creategold" and changin the src.newgold by src.creategold

[FUNCTION CreateGold]
IF (<ARGN>)
VAR.TOTALGOLD="<ARGN>"
WHILE (<VAR.TOTALGOLD> > 0)
NEWITEM=i_gold
IF (<VAR.TOTALGOLD> > 50000)
ACT.AMOUNT=50000
VAR.Created="<EVAL <VAR.TOTALGOLD>+ -50000>"
ELSE
ACT.AMOUNT=<VAR.TOTALGOLD>
VAR.TOTALGOLD=
ENDIF
ACT.CONT=<FINDLAYER.21.UID>
ENDWHILE
RETURN 1
ENDIF
RETURN 0

But it's not giving gold.
Maybe, maybe this could help you:https://forum.spherecommunity.net/Thread...t=add+gold and discusion on Discord.

But I mean, you're already discussing Discord. If you're Tonyuo in the x-branch section.

Look for this message from Jhobean on discord. You don't have "Bounce" there. https://discord.com/channels/35435831537...0996010065
Thanks for your help

The problem was write .link.newgold rather than write .src.newgold


Thank you so much




I take this post to ask something: How can I write this to affect the numbers I want (for example 1, 4, 7, 10 ...) instead of 0 to 12

IF (<VAR.ROLLVALUE><=12)
//Low range
VAR.THIRDRANGE=1
PHP Code:
If ( (<Var.RollValue> == 1) && (<Var.RollValue> == 4) && (<Var.RollValue> == 7) && (<Var.RollValue> == 10) )
   
//Low range
   
VAR.ThirdRange 1
Endif


// Or you can try it with For (I recommend more)
For 1000    // I don't know what can be thrown the highest number in roulette (edit) 
   
If ( (<Local._For> == 1) || (<local._for> == 4) || (<local._for> == 7) || (<local._for> == 10) )
      VAR.
ThirdRange 1
   
Endif
Endfor 

&& means "and", || means "or" - I don't know how you want to use the function. Whether the numbers are to be all together or individually. You have to choose that yourself.
It's just an idea, you have to play with the code more yourself. And I recommend you go to Discord, there are more experienced gentlemen who script better. I'm just a layman.
Thank you so much.

I'll choose the second one.


I am really thankfull
Reference URL's