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

Global storage

Ninja Bodil

New Member
Joined
Mar 7, 2009
Messages
116
Reaction score
0
Oki i want this:
If global storage = x
then do telport all player with storagevalue z to 1000,1000,7
and telport all player with storage value y to 2000,2000,7

And if global storage = y
then do telport all player with storagevalue y to 1000,1000,7
and telport all player with storage value z to 2000,2000,7
 
Code:
local globalStorageKey = 9001
local playerStorageKey = 5000
local global = getStorage(globalStorageKey) == x and x or getStorage(globalStorageKey) == y and y
if isInArray({x,y}, global) then
	for _, pid in ipairs(getPlayersOnline()) do
		local s = getPlayerStorageValue(pid, playerStorageKey)
		if global == x then
			if s == z then
				doTeleportThing(pid, {x=1000, y=1000, z=7})
			elseif s == y then
				doTeleportThing(pid, {x=2000, y=2000, z=7})
			end
		elseif global == y then
			if s == y then
				doTeleportThing(pid, {x=1000, y=1000, z=7})
			elseif s == z then
				doTeleportThing(pid, {x=2000, y=2000, z=7})
			end
		end
	end
end
 
Hmm this only works when i reload movements (yes i have it in movements)

Edit:
If i just make this a globalevent it tp even if the globalstorage is 0
 
Last edited:
Dosen't work for me i'll give you all the numbers I need because i maybe fuck it up when i config it.
Global storage x = 7400
Global storage y = 7300
player storage z = 8300
player storage y = 8400
Position = 1000,1000,7
hope you can help :eek:
 
like this?
u didnt give enof explaination =//=
Code:
local s = {
	firstG = 7400,
	secondG = 7300,
	firstP = 8300,
	secondP = 8400
}
function onThink(interval, lastExecution)
	for _, cid in ipairs(getPlayersOnline()) do
		local thisBullShit = {
			{s.firsG, s.firstP, {x = 1000, y = 1000, z = 7}},
			{s.secondG, s.secondP, {x = 1000, y = 1000, z = 7}}
		}
		for _, thisShit in ipairs(thisBullShit) do
			if getPlayerStorageValue(cid, thisShit[2]) == 1 and getGlobalStorageValue(thisShit[1]) == 1 then
				doTeleportThing(cid, thisShit[3], true)
			end
		end
	end
	return true
end
 
Back
Top