• 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 Requesting OnStep Script and Trap dmg Script

Bladefist

New Member
Joined
Oct 26, 2010
Messages
65
Reaction score
0
Location
Carlin
Hello, I need two scripts, following:


OnStep Script so if you are level >= 350, nothing happens, but if you're less than level 350 you'll be teleported to 30,10,7.
And get player message "You don't have the required level to pass". or something.

Secondly. A trap script

When a player walk on a Trap (ID 1510) the player will lose 1000 hit points and the trap will transform to (ID 1511).
After few seconds It'll go back to (ID 1510) and take 1000 points on next player that dares to walk on it.
 
and take 1000 points on next player that dares to walk on it.

wHAT?

Lua:
function onStepIn(cid, item, pos)

local p = {x=30, y=10, z=7}

if getPlayerLevel(cid) >= 350 then
	if isPlayer(cid) == 1 then
		doPlayerSendTextMessage(cid, 22, "You don't have the required level to pass")
	else
		doTeleportThing(cid, p)
                -- doRelocate(pos, p) -- You can use Relocate if you want, or just doTeleportThing 
		doSendMagicEffect(p, 10) -- Not sure if this is needed.
	end
	return TRUE
end

Lua:
function onStepIn(cid, item, pos)

	if isPlayer(cid) == 1 then
		doCreatureAddHealth(cid, -1000)
		doSendMagicEffect(pos,1)
		doSendAnimatedText(pos, '1000', TEXTCOLOR_RED)
	end
	return TRUE
end
 
Last edited:
Your didn't work, it was missing something. Anyways how do I make this one work but I would like StorageValue as requirement instead of level as well. If you have done quest (cid, 5000) you can walk on floor if not, player is teleported instantly away. Just like the bridge in rookgaard, although the requirement there is premium.

function onStepin(cid, item, frompos, item2, topos)

if item.uid == 4444 and item.itemid == 4972 then
player1pos = {x=663, y=852, z=7, stackpos=253}
player1 = getThingfromPos(player1pos)


if getPlayerLevel(cid) >= 350 then
end
if getPlayerLevel(cid) <= 349 then
nplayer1pos = {x=733, y=41, z=8}
doSendMagicEffect(player1pos,2)
doTeleportThing(player1.uid,nplayer1pos)
doSendMagicEffect(nplayer1pos,10)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
 
Lua:
function onStepIn(cid, item, pos)

local v = getPlayerStorageValue(cid, 5000)
local p = {x=733, y=41, z=8}

	if isPlayer(cid) == 1 then
		if v == 1 then
		return true
	else	
		doTeleportThing(cid, p)
	end
	
end
	return TRUE
end
 
Back
Top