[CODE]hook.Add( "PlayerSay", "Lottery", function( ply, text, public )
text = string.lower( text )
if ( text == "!lottery" ) then
ply:PrintMessage( HUD_PRINTTALK, "[Lottery] Want to join, the jackpot? Type !lottery join, and spend 50 SvCreds, and support jacobs work!" )
return ""
else
end
end )
hook.Add( "PlayerSay", "LotteryJoin", function( ply, text, public )
text = string.lower( text )
if ( text == "!lottery join" ) and math.random( 1, 10 ) == 1 then
ply:PrintMessage( HUD_PRINTTALK, "[Lottery] Sweet, you just won: 1000 SovCreds!" )
ply:PS_GivePoints(950)
return ""
elseif ( text == "!lottery join" ) then
ply:PrintMessage( HUD_PRINTTALK, "[Lottery] Sadley, you lost. To win, there is a 1/10 chance!" )
ply:PS_TakePoints(50)
return ""
else
end
end )[/CODE]
I need help, my lottery command !lottery just dosent load. And when it does the !lottery join dosent work. ( But they all work !lottery/!lottery join )
Please help! They dont do what I want.
Where are you running this? Also, try removing the 'else' bits in your code that have nothing being run in them
[editline]18th June 2016[/editline]
Also, this code is very exploitable. math.random can return the same thing twice, and clients could win tons of money by just running the PlayerSay command again and again
Sorry, you need to Log In to post a reply to this thread.