• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

3 scripts

poii

Member
Joined
Nov 11, 2008
Messages
188
Reaction score
8
Hello i'm asking for 3 scipts hope you can help me :)
1. when a player is in x position and say password it is teleported to y position...

2. when player1 is in x position, player2 is in y position and player3 is in z position the 3 of them are teleported to xyz position :)

3. when the playe killed his 100th player he get warmaster addon!

i REP++ :D!!
ok i added a 4th
4. when player say !outfit it get random an old free outfit and if says
!premoutfit if player is premmy then do player get a random premium old outfit
 
Last edited:
    • password.lua:
    Code:
    local pos = {x=100, y=100, z=7}
    
    function onSay(cid, words, param)
    	local p = getThingPos(cid)
    	if pos.x == p.x and pos.y == p.y and pos.z == p.z then
    		doSendMagicEffect(p, CONST_ME_TELEPORT)
    		doTeleportThing(cid, pos)
    		doSendMagicEffect(pos, CONST_ME_TELEPORT)
    	end
    end
    • talkactions.xml:
    Code:
    <talkaction words="password" event="script" value="password.lua"/>
    • teleport.lua:
    Code:
    local pos = {x=100, y=100, z=7}
    
    function onStepIn(cid, item, position, fromPosition)
    	local players = {}
    	for i = 2501, 2503 do
    		local v = getTopCreature(getThingPos(i)).uid
    		if not isPlayer(v) then
    			return
    		end
    		table.insert(players, v)
    	end
    	for i = 1, #players do
    		doSendMagicEffect(getThingPos(players[i]), CONST_ME_TELEPORT)
    		doTeleportThing(players[i], pos)
    	end
    	doSendMagicEffect(pos, CONST_ME_TELEPORT)
    end
    • movements.xml
    Code:
    <movevent type="StepIn" uniqueid="2501-2503" event="script" value="teleport.lua"/>
    • addon.lua:
    Code:
    local storage = 3000
    local amount = 100
    
    function onKill(cid, target, lastHit)
    	if lastHit and isPlayer(target) and target ~= cid then
    		local new = math.max(0, getPlayerStorageValue(cid, storage)) + 1
    		setPlayerStorageValue(cid, storage, new)
    		if new == amount then
    			doPlayerAddOutfitId(cid, 22, 3)
    		end
    	end
    	return true
    end
    • login.lua:
    Code:
    	registerCreatureEvent(cid, "Addon")
    • creaturescripts.xml:
    Code:
    	<event type="kill" name="Addon" event="script" value="addon.lua"/>
    • outfit.lua
    Code:
    local t = {
    	['!outfit'] = {
    		[0] = {136, 137, 138, 139},
    		[1] = {128, 129, 130, 131}
    	},
    	['!premoutfit'] = {
    		[0] = {140, 141, 142, 147, 148, 149, 150, 155, 156, 157, 158, 252, 269, 270, 279, 288, 324, 336},
    		[1] = {132, 133, 134, 143, 144, 145, 146, 151, 152, 153, 154, 251, 268, 273, 278, 289, 325, 335}
    	}
    }
    
    function onSay(cid, words, param)
    	if words == 'premoutfit' and not isPremium(cid) then
    		return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUNEEDPREMIUMACCOUNT)
    	end
    	local now = getCreatureOutfit(cid)
    	local v = t[words][getPlayerSex(cid)]
    	now.lookType, now.lookAddons = v[math.random(#v)], 0
    	doCreatureChangeOutfit(cid, now)
    	return true
    end
    • talkactions.xml
    Code:
    	<talkaction words="!outfit;!premoutfit" event="script" value="outfit.lua"/>
 
Last edited:
wait on first is needed to step on a position x-y-z so player can say the password if he is not on x-y-z position then nothing happens
 
@up
actually that is what he made :)
just that
LUA:
local pos = {x=100, y=100, z=7}
local poss = {x=102, y=100, z=7}  --place where he will be tped

function onSay(cid, words, param)
	local p = getThingPos(cid)
	if pos.x == p.x and pos.y == p.y and pos.z == p.z then
		doSendMagicEffect(p, CONST_ME_TELEPORT)
		doTeleportThing(cid, poss)
		doSendMagicEffect(poss, CONST_ME_TELEPORT)
	end
end
 
oh thanks ! :P
and this on outfit?

[26/07/2010 01:54:14] [Error - TalkAction Interface]
[26/07/2010 01:54:14] data/talkactions/scripts/outfit.lua:onSay
[26/07/2010 01:54:14] Description:
[26/07/2010 01:54:14] data/talkactions/scripts/outfit.lua:18: attempt to get length of local 'v' (a nil value)
[26/07/2010 01:54:14] stack traceback:
[26/07/2010 01:54:14] data/talkactions/scripts/outfit.lua:18: in function <data/talkactions/scripts/outfit.lua:12>
 
LUA:
local t = {
	['!outfit'] = {
		[0] = {136, 137, 138, 139},
		[1] = {128, 129, 130, 131}
	},
	['!premoutfit'] = {
		[0] = {140, 141, 142, 147, 148, 149, 150, 155, 156, 157, 158, 252, 269, 270, 279, 288, 324, 336},
		[1] = {132, 133, 134, 143, 144, 145, 146, 151, 152, 153, 154, 251, 268, 273, 278, 289, 325, 335}
	}
}

function onSay(cid, words, param)
	if words == 'premoutfit' and not isPremium(cid) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUNEEDPREMIUMACCOUNT)
	end
	local now = getCreatureOutfit(cid)
	local v = t[words][getPlayerSex(cid)]
	now.lookType, now.lookAddons = v[math.random(#v)], 0
	doCreatureChangeOutfit(cid, now)
	return true
end
 
humm ok lets see :)

Code:
local t = {
	['!outfit'] = {
		[0] = {136, 137, 138, 139},
		[1] = {128, 129, 130, 131}
	},
	['!premoutfit'] = {
		[B][I][U][0][/U][/I][/B] = {140, 141, 142, 147, 148, 149, 150, 155, 156, 157, 158, 252, 269, 270, 279, 288, 324, 336},
		[B][I][U][0][/U][/I][/B] = {132, 133, 134, 143, 144, 145, 146, 151, 152, 153, 154, 251, 268, 273, 278, 289, 325, 335}
	}
}

function onSay(cid, words, param)
	if words == 'premoutfit' and not isPremium(cid) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUNEEDPREMIUMACCOUNT)
	end
	local now = getCreatureOutfit(cid)
	local v = t[words][getPlayerSex(cid)]
	now.lookType, now.lookAddons = v[math.random(#v)], 0
	doCreatureChangeOutfit(cid, now)
	return true
end


Code:
local pos = {x=100, y=100, z=7}

function onStepIn(cid, item, position, fromPosition)
	local players = {}
	for i = 2501, 2503 do
		local v = getTopCreature(getThingPos(i)).uid
		if not isPlayer(v) then
			return
		end
		table.insert(players, v)
	end
	for i = 1, #players do
		doSendMagicEffect(getThingPos(players[i]), CONST_ME_TELEPORT)
		doTeleportThing(players[i], pos)
	end
	doSendMagicEffect(pos, CONST_ME_TELEPORT)
end

And here you made 1 local for the required place and the tp place :)
(didnt give an error , but he didnt know where to put tp place)
 
Back
Top