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

Storage Check, Teleport Script

avalock

New Member
Joined
Feb 5, 2013
Messages
16
Reaction score
3
Location
Great Britain
Hey guys, was wondering if anyone would be able to help me make a script?

Basically i needed something that checks a players Storage Value onStepIn, and depending on the value teleport a player to a possition. For example. Storage ID 666011, then Values 001,002,003,004,005,006,007,008,009,010 & 011. Each value has a different destination. i know how to make a basic one, Checking If, elseif, elseif, etc... Just wondered if there is an easyer way to do this? Thanks all
 
Lua:
local config = {
	[1] = {pos = {x = 100, y = 100, z = 7}},
	[2] = {pos = {x = 100, y = 100, z = 7}},
	[3] = {pos = {x = 100, y = 100, z = 7}},
	[4] = {pos = {x = 100, y = 100, z = 7}},
	[5] = {pos = {x = 100, y = 100, z = 7}},
	[6] = {pos = {x = 100, y = 100, z = 7}},
	[7] = {pos = {x = 100, y = 100, z = 7}},
	[8] = {pos = {x = 100, y = 100, z = 7}},
	[9] = {pos = {x = 100, y = 100, z = 7}},
	[10] = {pos = {x = 100, y = 100, z = 7}},
	[11] = {pos = {x = 100, y = 100, z = 7}}
}

function onStepIn(cid, item, position, fromPosition)

local storage = getPlayerStorageValue(cid, 666011)

	if config[storage] then
		doTeleportThing(cid, config[storage].pos)
		doSendMagicEffect(config[storage].pos, CONST_ME_TELEPORT)
	else
		doTeleportThing(cid, fromPosition)
		doPlayerSendCancel(cid, "You don't have the storage to enter.")
	end
	return true
end
 
Last edited:
Back
Top