SphereCommunity
Rulette is not giving gold - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere X (/Forum-Sphere-X)
+--- Forum: Script Help (/Forum-Script-Help--59)
+--- Thread: Rulette is not giving gold (/Thread-Rulette-is-not-giving-gold)



Rulette is not giving gold - Joshua - 10-29-2021 06:59 AM

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


RE: Rulette is not giving gold - Joshua - 10-29-2021 08:43 PM

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.


RE: Rulette is not giving gold - golfin - 10-30-2021 11:28 AM

Maybe, maybe this could help you:https://forum.spherecommunity.net/Thread-Gold-Bag-Bank?highlight=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/354358315373035542/476635430821953567/903610140996010065


RE: Rulette is not giving gold - Joshua - 10-30-2021 08:29 PM

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


RE: Rulette is not giving gold - golfin - 10-31-2021 01:44 PM

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.


RE: Rulette is not giving gold - Joshua - 10-31-2021 05:16 PM

Thank you so much.

I'll choose the second one.


I am really thankfull


This forum uses Lukasz Tkacz MyBB addons.