Jump to content

Gamble Sk


Recommended Posts

options:
	permission: gamble.use
	permission message: &4You do not have access to this command.
	usage: Usage: /gamble <amount>
	chance: 50%
	pay out: 2 #The number the original number gets multiplied by if they win (Ex. If you gamble $10 and win, you get $20)


command /gamble <number>:
	permission: {@permission}
	permission message: {@permission message}
	usage: {@usage}
	trigger:
		if player's balance is less than arg-1:
			message "&cYou do not have enough money to gamble this amount!"
		else:
			remove arg-1 from player's balance
			message "&eBetting $&e%arg-1%&e..."
			wait 3 seconds
			set {_gambled} to arg-1
			set {_out} to ({_gambled}*{@pay out})
			chance of {_chance}:
				send title "&a&lYou won!" with subtitle "&aYou won &a%{_out}%&a!" to player
				add {_out} to player's balance
			else:
				send title "&c&lYou lost!" with subtitle "&cYou did not win &c%{_out}%&c!"

 

  • Like 1

» IGN: _iZ_ «

» Joined: 12/18/2016 «

» VIP: 1/13/2018 «

» Helper: 1/29/2021 «

» [<3]: 5/8/2021 «

» Skript dev «

» Discord: iZz#0420 «

I have diabetes

React to this if I was helpful, found this interesting, or you're just nice 🙂

Link to comment
Share on other sites

4 hours ago, izzzzthewiz said:

options: permission: gamble.use permission message: &4You do not have access to this command. usage: Usage: /gamble <amount> chance: 50% pay out: 2 #The number the original number gets multiplied by if they win (Ex. If you gamble $10 and win, you get $20) command /gamble <number>: permission: {@permission} permission message: {@permission message} usage: {@usage} trigger: if player's balance is less than arg-1: message "&cYou do not have enough money to gamble this amount!" else: remove arg-1 from player's balance message "&eBetting $&e%arg-1%&e..." wait 3 seconds set {_gambled} to arg-1 set {_out} to ({_gambled}*{@pay out}) chance of {_chance}: send title "&a&lYou won!" with subtitle "&aYou won &a%{_out}%&a!" to player add {_out} to player's balance else: send title "&c&lYou lost!" with subtitle "&cYou did not win &c%{_out}%&c!

So it always fails, i never win, can you fix this please?
 

Screenshot_49.png.391647f40dd20d7ce6217bca456b44af.png 

 

MamaSita

not banned

 

Link to comment
Share on other sites

Sorry, I messed something up xD

options:
	permission: gamble.use
	permission message: &4You do not have access to this command.
	usage: Usage: /gamble <amount>
	chance: 50%
	pay out: 2 #The number the original number gets multiplied by if they win (Ex. If you gamble $10 and win, you get $20)


command /gamble <number>:
	permission: {@permission}
	permission message: {@permission message}
	usage: {@usage}
	trigger:
		if player's balance is less than arg-1:
			message "&cYou do not have enough money to gamble this amount!"
		else:
			remove arg-1 from player's balance
			message "&eBetting $&e%arg-1%&e..."
			wait 3 seconds
			set {_gambled} to arg-1
			set {_out} to ({_gambled}*{@pay out})
			chance of {@chance}:
				send title "&a&lYou won!" with subtitle "&aYou won $&a%{_out}%&a!" to player
				add {_out} to player's balance
				stop
			else:
				send title "&c&lYou lost!" with subtitle "&cYou did not win $&c%{_out}%&c!"

I tested it and it works

» IGN: _iZ_ «

» Joined: 12/18/2016 «

» VIP: 1/13/2018 «

» Helper: 1/29/2021 «

» [<3]: 5/8/2021 «

» Skript dev «

» Discord: iZz#0420 «

I have diabetes

React to this if I was helpful, found this interesting, or you're just nice 🙂

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...