• 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:
3)
Lua:
function onKill(cid,target)
if isPlayer(cid) and isPlayer(target) and getCreatureSkullType(target) == 0 then
  doPlayerAddMoney(cid, 500)
end
return true
end
 
creaturescript.xml
Code:
<event type="kill" name="dier" event="script" value="xxxx.lua"/>
in login.lua [before last return true]
Code:
registerCreatureEvent(cid, "dier")
 
oh thanks man but i no understand this line

what should i change in globalevents ?

serch for this line in mode file
Code:
<globalevent name="Map Change" interval="900" event="script"><![CDATA[

change interval to the time too, and are you using a 1/1 and 2/2 war server , or each player will create his character?
 
serch for this line in mode file
Code:
<globalevent name="Map Change" interval="900" event="script"><![CDATA[

change interval to the time too, and are you using a 1/1 and 2/2 war server , or each player will create his character?

firstly theres no any line like that and when i add it in exe got a bug and unable to open globalevents

secondly i use account manager so every player create his character
 
firstly theres no any line like that and when i add it in exe got a bug and unable to open globalevents
ehmm... first this is a mod , so you put in mod folder second the line is here[scroll down it will be hilighted]
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Map Change" version="2.0" author="Syntax" contact="[email protected]" enabled="yes">
   <description>
        This should teleport all players to a new random town in intervals.
   </description>
	<config name="mapchange_config"><![CDATA[
		config = {
			access = 3, -- minimum access to bypass teleportation.
			temples = {1,2,5,3}, -- townids to teleport to.
			storage = 3454, -- number to store map status in.
			changetime = 900 -- time to change in seconds (change in globalevents too)
		}
 ]]></config>
     <event type="login" name="Map Login" event="script"><![CDATA[
	domodlib('mapchange_config')
		function onLogin(cid)
			doPlayerSetTown(cid, getGlobalStorageValue(config.storage))
			doTeleportThing(cid, getPlayerMasterPos(cid))
		return true
		end
]]></event>
	[COLOR="Magenta"][B]<globalevent name="Map Change" interval="900" event="script"><![CDATA[[/B][/COLOR]
	domodlib('mapchange_config')
		function onThink(interval, lastExecution, thinkInterval)
			repeat
				RDM = math.random(1,#config.temples)
			until RDM ~= getGlobalStorageValue(config.storage) and isInArray(config.temples, RDM)
			if getWorldCreatures(0) > 0 then
				for _, pid in ipairs(getPlayersOnline()) do
					if getPlayerAccess(pid) < config.access and getPlayerAccountManager(pid) == MANAGER_NONE then
						doPlayerSetTown(pid, config.temples[RDM])
						doTeleportThing(pid, getTownTemplePosition(config.temples[RDM]), false)
						doSendMagicEffect(getCreaturePosition(pid), 37)
						doCreatureAddHealth(pid, getCreatureMaxHealth(pid))
						doCreatureAddMana(pid, getCreatureMaxMana(pid))
						doRemoveConditions(pid, FALSE)
					end
				doBroadcastMessage("Round over. Map switched to " ..getTownName(config.temples[RDM]).. ".", MESSAGE_EVENT_ADVANCE)
				setGlobalStorageValue(config.storage, config.temples[RDM])
				end
			else
				print ("[MAP] No players online, aborting map change!")
			end
		return true
		end
]]></globalevent>
</mod>
 
Last edited:
got a bug

Code:
Error-creaturescript interface
buffer:onlogin
Description
[string "loadbuffer"]:3: attempt to index global 'config' <a nile value>
stack tracebacck:
[string "load buffer"]:3: in funcation <[string "loadbuffer']:2>
and i cant login into a game while the mod in mods folder
 
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
  setPlayerStorageValue(cid,9896,1)
  doRemoveCreature(cid)
  db.executeQuery("UPDATE `players` SET `save` = 0 WHERE `name` = '" .. pname .. "';")

  end
 
Last edited:
Back
Top