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

Solved [TFS 1.2] Random Teleport

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
Hi folks, I need a little light on my new script, does not give any kind error, just don't work.

The main idea is a random teleport can appers in positon (1000, 1000, 7) or (1002, 1002, 7) or (1004, 1004, 7) with a actionid and will set a global storage.

Code:
local t = {
   {Position(1000, 1000, 7), storage = 125},
   {Position(1002, 1002, 7), storage = 124},
   {Position(1004, 1004, 7), storage = 123}
}

local v = t[math.random(#t)]
local teleport = Game.createItem(1387, 1, v)
if teleport:isTeleport() then
   Game.setStorageValue(v.storage)
   teleport:setActionId(98456)
end

Thanks.
 
just setting a "pos" in the table?
something like this:
Code:
local t = {
   {pos = Position(1000, 1000, 7), storage = 125},
   {pos = Position(1002, 1002, 7), storage = 124},
   {pos = Position(1004, 1004, 7), storage = 123}
}

local v = t[math.random(#t)]
local teleport = Game.createItem(1387, 1, v.pos)
if teleport:isTeleport() then
   Game.setStorageValue(v.storage)
   teleport:setActionId(98456)
end
try.
 
@silvera
oh shit! I forget that, XDDDD!

My bad, thanks dude. Just one more thing, why it isn't setting the global storage?

@edit

fixed by using (v.storage, 1)
 
Back
Top