Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rulette is not giving gold
Author Message
Joshua
Apprentice
*

Posts: 11
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #1
Rulette is not giving gold
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
(This post was last modified: 10-29-2021 07:04 AM by Joshua.)
10-29-2021 06:59 AM
Find all posts by this user Like Post Quote this message in a reply
Joshua
Apprentice
*

Posts: 11
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #2
RE: Rulette is not giving gold
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.
10-29-2021 08:43 PM
Find all posts by this user Like Post Quote this message in a reply
golfin
Banned

Posts: 213
Likes Given: 2
Likes Received: 32 in 28 posts
Joined: Nov 2017

Eranova

Post: #3
RE: Rulette is 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
(This post was last modified: 10-30-2021 11:42 AM by golfin.)
10-30-2021 11:28 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Joshua
Apprentice
*

Posts: 11
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #4
RE: Rulette is not giving gold
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
10-30-2021 08:29 PM
Find all posts by this user Like Post Quote this message in a reply
golfin
Banned

Posts: 213
Likes Given: 2
Likes Received: 32 in 28 posts
Joined: Nov 2017

Eranova

Post: #5
RE: Rulette is not giving gold
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.
10-31-2021 01:44 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Joshua
Apprentice
*

Posts: 11
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #6
RE: Rulette is not giving gold
Thank you so much.

I'll choose the second one.


I am really thankfull
10-31-2021 05:16 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)