• 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!

Lua One script error

narko

vertrauenswürdig ~
Joined
Oct 19, 2008
Messages
1,317
Solutions
2
Reaction score
132
Location
Unknown
Hello im making a script and in the console dont shows errors so in the moment of im enter in the server causes debug please check im think is a wrong lua function. PLease help me i give REP to helper :D


LUA:
local outfit = {
re = {lookType = 133, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94},
blu = {lookType = 133, lookHead = 87, lookBody = 87, lookLegs = 87, lookFeet = 87}
}

local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}


function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid,MESSAGE_EVENT_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

        --Thais Done
      if getGlobalStorageValue(61911) then
      if getPlayerStorageValue(cid,2430) then
          doTeleportThing(cid, {x=552, y=226, z=7})
           doCreatureChangeOutfit(cid, outfit.re)
      end
end

      if getGlobalStorageValue(61911) then
      if getPlayerStorageValue(cid,2431) then
          doTeleportThing(cid, {x=494, y=158, z=6})
              doCreatureChangeOutfit(cid, outfit.blu)
      end
end
        --Edron Done
      if getGlobalStorageValue(61912) then
      if getPlayerStorageValue(cid,2432) then
          doTeleportThing(cid, {x=601, y=571, z=7})
           doCreatureChangeOutfit(cid, outfit.re)
      end
end
      if getGlobalStorageValue(61912) then
        if getPlayerStorageValue(cid,24323) then
          doTeleportThing(cid, {x=480, y=553, z=6})
           doCreatureChangeOutfit(cid, outfit.blu)
      end
end
        --Venore 
      if getGlobalStorageValue(61913) then
        if getPlayerStorageValue(cid,24324) then 
          doTeleportThing(cid, {x=654, y=847, z=7})
           doCreatureChangeOutfit(cid, outfit.re)
      end
end

      if getGlobalStorageValue(61913) then
         if getPlayerStorageValue(cid,24325) then
            doTeleportThing(cid, {x=752, y=825, z=7})
           doCreatureChangeOutfit(cid, outfit.blu)
      end
end


	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end
		registerCreatureEvent(cid, "Mail")
		registerCreatureEvent(cid, "AdvanceSave")
		registerCreatureEvent(cid, "GuildMotd")
		registerCreatureEvent(cid, "Idle")
		registerCreatureEvent(cid, "Setpos")
	      registerCreatureEvent(cid, "ifd") 
	      registerCreatureEvent(cid, "ifk") 
	      registerCreatureEvent(cid, "ifp") 
	      registerCreatureEvent(cid, "ifs")
		registerCreatureEvent(cid, "SkullSystem")
	return true
end
 
@Martyx el Script en esta parte
LUA:
--Thais Done
      if getGlobalStorageValue(61911) then
      if getPlayerStorageValue(cid,2430) then
          doTeleportThing(cid, {x=552, y=226, z=7})
           doCreatureChangeOutfit(cid, outfit.re)
      end
end
 
      if getGlobalStorageValue(61911) then
      if getPlayerStorageValue(cid,2431) then
          doTeleportThing(cid, {x=494, y=158, z=6})
              doCreatureChangeOutfit(cid, outfit.blu)
      end
end
        --Edron Done
      if getGlobalStorageValue(61912) then
      if getPlayerStorageValue(cid,2432) then
          doTeleportThing(cid, {x=601, y=571, z=7})
           doCreatureChangeOutfit(cid, outfit.re)
      end
end
      if getGlobalStorageValue(61912) then
        if getPlayerStorageValue(cid,24323) then
          doTeleportThing(cid, {x=480, y=553, z=6})
           doCreatureChangeOutfit(cid, outfit.blu)
      end
end
        --Venore 
      if getGlobalStorageValue(61913) then
        if getPlayerStorageValue(cid,24324) then 
          doTeleportThing(cid, {x=654, y=847, z=7})
           doCreatureChangeOutfit(cid, outfit.re)
      end
end
 
      if getGlobalStorageValue(61913) then
         if getPlayerStorageValue(cid,24325) then
            doTeleportThing(cid, {x=752, y=825, z=7})
           doCreatureChangeOutfit(cid, outfit.blu)
      end
end

Supongamos que cada ves que cambia un mapa se Activa un setGlobalStorage(xxxx) Por eso si un player se hace una cuenta despues que hayan cambiado el mapa tambien los teletrasporte al mapa actual...


English:

@Martyx in this part of code:
LUA:
--Thais Done
      if getGlobalStorageValue(61911) then
      if getPlayerStorageValue(cid,2430) then
          doTeleportThing(cid, {x=552, y=226, z=7})
           doCreatureChangeOutfit(cid, outfit.re)
      end
end
 
      if getGlobalStorageValue(61911) then
      if getPlayerStorageValue(cid,2431) then
          doTeleportThing(cid, {x=494, y=158, z=6})
              doCreatureChangeOutfit(cid, outfit.blu)
      end
end
        --Edron Done
      if getGlobalStorageValue(61912) then
      if getPlayerStorageValue(cid,2432) then
          doTeleportThing(cid, {x=601, y=571, z=7})
           doCreatureChangeOutfit(cid, outfit.re)
      end
end
      if getGlobalStorageValue(61912) then
        if getPlayerStorageValue(cid,24323) then
          doTeleportThing(cid, {x=480, y=553, z=6})
           doCreatureChangeOutfit(cid, outfit.blu)
      end
end
        --Venore 
      if getGlobalStorageValue(61913) then
        if getPlayerStorageValue(cid,24324) then 
          doTeleportThing(cid, {x=654, y=847, z=7})
           doCreatureChangeOutfit(cid, outfit.re)
      end
end
 
      if getGlobalStorageValue(61913) then
         if getPlayerStorageValue(cid,24325) then
            doTeleportThing(cid, {x=752, y=825, z=7})
           doCreatureChangeOutfit(cid, outfit.blu)
      end
end

Suppose that every time you change a map activates a setGlobalStorage (xxxx) So if a player is an account after they have changed the map also teleport to map the current ...
 
Back
Top