• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Script request rep ++

Calon

Experienced Member
Joined
Feb 6, 2009
Messages
1,070
Reaction score
21
1)am searching for script that show auto best 5 frags ingame every 1h
2)also that send players to x y z every 3 hs auto while they online. thanks (rep ++_
3)when player get frag he take 5 platinum
4)when player die dont lose any item and back to lvl 100 that mean save(0)
 
Last edited:
for player save 0
add this in login.lua, thi will let player dont log for the first time he log in server.so he need to type his pass and acc again, or you can just make the default of save = 0 in database
Lua:
pname = getCreatureName(cid)
if getPlayerStorageValue(cid,9896) < 0 then
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `save` = 0 WHERE `name` = '" .. pname .. "';")
  setPlayerStorageValue(cid,9896,1)
  end

no i no mean that
i just want when he die dont lose items and back to first lvl he started with ( he login afterthat ) save =0
 
dud just put that and it will work as you want, just to make save 0 player must be logged out so this script kick the player and execute the query(that only happen when he log for the first time in sevrer)
 
i find out this bug
error-luascriptinterface::loadfile] data/creaturescripts/scripts/login/lua: '<eof>' expected near 'end'
Warning - event::loadscript] cannot load script ,data/creaturescripts/scripts/login.lua>
data/creaturescripts/scripts/login.lua:109: '<eof>' expected near 'end'
 
Code:
local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = 

getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
accountManager = "Account Manager"                       
managerCounter = 0

   for i, player in ipairs(getOnlinePlayers()) do
      if accountManager:lower() == player:lower() then             
      managerCounter = managerCounter + 1
      end 
   end
 
   if managerCounter >= 3 then
      return false
   end
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss 

* 10)
	end
[COLOR="Red"][B]pname = getCreatureName(cid)
if getPlayerStorageValue(cid,9896) < 0 then
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `save` = 0 WHERE `name` = '" .. 

pname .. "';")
  setPlayerStorageValue(cid,9896,1)
  end[/B][/COLOR]

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), 

config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, 

MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a 

%b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, 

str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, 

MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character 

has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, 

MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your 

account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, 

MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an 

account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), 

CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")

	registerCreatureEvent(cid, "Idle")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end

registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "attackguild")	
registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "FimVip")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "demonOakLogout")
registerCreatureEvent(cid, "demonOakDeath")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, VipReceive)
registerCreatureEvent(cid, "PlayerKill")
registerCreatureEvent(cid, "KillingInTheNameOf")

    if (InitArenaScript ~= 0) then
    InitArenaScript = 1

        for i = 42300, 42309 do
            setGlobalStorageValue(i, 0)
            setGlobalStorageValue(i+100, 0)
        end
    end

    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end

    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end

    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end

end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0)
    end
    setPlayerStorageValue(cid, 42350, 0)
    setPlayerStorageValue(cid, 42352, 0)
return true
end

  local storage = 52321   --put any emty sotrage
function onlogin(cid)
if getPlayerStorageValue(cid,storage) < 0 then
   doPlayerSetPromotionLevel(cid, 1)
  setPlayerStorageValue(cid,storage,1)
end
registerCreatureEvent(cid, "dier")
return true
end
 
Lua:
local config = {
        loginMessage = getConfigValue('loginMessage'),
        useFragHandler = 

getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
accountManager = "Account Manager"                       
managerCounter = 0

   for i, player in ipairs(getOnlinePlayers()) do
      if accountManager:lower() == player:lower() then             
      managerCounter = managerCounter + 1
      end 
   end
 
   if managerCounter >= 3 then
      return false
   end
        local loss = getConfigValue('deathLostPercent')
        if(loss ~= nil) then
                doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
        end
pname = getCreatureName(cid)
if getPlayerStorageValue(cid,9896) < 0 then
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `save` = 0 WHERE `name` = '" .. pname .. "';")
  setPlayerStorageValue(cid,9896,1)
end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

                doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
        elseif(accountManager == MANAGER_NAMELOCK) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
        elseif(accountManager == MANAGER_ACCOUNT) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
        else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
        end

        if(not isPlayerGhost(cid)) then
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        end

        registerCreatureEvent(cid, "Mail")
        registerCreatureEvent(cid, "GuildMotd")

        registerCreatureEvent(cid, "Idle")
        if(config.useFragHandler) then
                registerCreatureEvent(cid, "SkullCheck")
        end

registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "attackguild")       
registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "FimVip")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "demonOakLogout")
registerCreatureEvent(cid, "demonOakDeath")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "VipReceive")
registerCreatureEvent(cid, "dier")
registerCreatureEvent(cid, "PlayerKill")
registerCreatureEvent(cid, "KillingInTheNameOf")

    if (InitArenaScript ~= 0) then
    InitArenaScript = 1

        for i = 42300, 42309 do
            setGlobalStorageValue(i, 0)
            setGlobalStorageValue(i+100, 0)
        end
    end

    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end

    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end

    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end

      local storage = 52321   --put any emty sotrage

if getPlayerStorageValue(cid,storage) < 0 then
   doPlayerSetPromotionLevel(cid, 1)
  setPlayerStorageValue(cid,storage,1)
end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0)
    end
    setPlayerStorageValue(cid, 42350, 0)
    setPlayerStorageValue(cid, 42352, 0)
return true
end
 
Last edited:
Warining-Event::loadscript] cannot load script <data/creaturescripts/scripts/login.lua>
data/creaturescripts/scripts/login.lua:46: unfinished string near '"%a'
 
Back
Top