International Gaming Community

Outside IGC => Scripting => Topic started by: StealthGamer on March 04, 2018, 01:21:29 am

Title: [TUT] No lifer script
Post by: StealthGamer on March 04, 2018, 01:21:29 am
Code: [Select]
function nolife()
for _, player in ipairs ( getElementsByType ( "player" ) ) do
if ( isGuestAccount ( getPlayerAccount ( player ) ) == true ) then return false end
local nolife = tonumber( getElementData( player, "nolifeScriptTime" ) ) or 0
setElementData( player, "nolifeScriptTime", nolife+1 )
nolife = tonumber( getElementData( player, "nolifeScriptTime" ) )
if ( nolife == 15 ) then
outputChatBox("#3A5FCD[Love RSG]#FFFFFFYou get 500$ for playing 15 minutes in RSG", player, 255, 255, 255, true )
givePlayerMoney( player, 500 )
elseif ( nolife == 30 ) then
outputChatBox("#3A5FCD[Love RSG]#FFFFFFYou get 1000$ for playing 30 minutes in RSG", player, 255, 255, 255, true )
givePlayerMoney( player, 1000 )
elseif ( nolife == 60 ) then
outputChatBox("#3A5FCD[Love RSG]#FFFFFFYou get 1500$ for playing 1 hour in RSG", player, 255, 255, 255, true )
givePlayerMoney( player, 1500 )
elseif ( nolife == 90 ) then
outputChatBox("#3A5FCD[Love RSG]#FFFFFFYou get 2500$ for playing 1 hour and 30 minutes in RSG", player, 255, 255, 255, true )
givePlayerMoney( player, 2500 )
elseif ( nolife == 120 ) then
outputChatBox("#3A5FCD[Love RSG]#FFFFFFYou get 3500$ for playing 2 hours in RSG", player, 255, 255, 255, true )
givePlayerMoney( player, 3500 )
elseif ( nolife == 180 ) then
outputChatBox("#3A5FCD[Love RSG]#FFFFFFYou get 6000$ for playing 3 hours in RSG", player, 255, 255, 255, true )
givePlayerMoney( player, 6000 )
elseif ( nolife == 240 ) then
outputChatBox("#3A5FCD[Love RSG]#FFFFFFYou get 8000$ for playing 4 hour in RSG", player, 255, 255, 255, true )
givePlayerMoney( player, 8000 )
elseif ( nolife == 300 ) then
outputChatBox("#3A5FCD[Love RSG]#FFFFFFYou get 12000$ for playing 5 hour in RSG", player, 255, 255, 255, true )
givePlayerMoney( player, 12000 )
elseif ( nolife == 360 ) then
outputChatBox("#3A5FCD[Love RSG]#FFFFFFYou get 18000$ for playing 6 hour in RSG", player, 255, 255, 255, true )
givePlayerMoney( player, 18000 )
end
end
end
setTimer( nolife, 60000, 0)
Title: Re: [TUT] No lifer script
Post by: StealthGamer on March 04, 2018, 08:45:03 am
elseif? Should to be if without else.
and u should revice ends.
few codes is incorrect.
good job!
What tf u sayin??
Title: Re: [TUT] No lifer script
Post by: Emile on March 04, 2018, 10:28:27 am
if ( isGuestAccount ( getPlayerAccount ( player ) ) == true ) then return false end
This will cause to abort the script so if a player isn't logged in, your script wont work at all.
SimplePortal 2.3.7 © 2008-2024, SimplePortal