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

Catapulta System

creatserver

New Member
Joined
Feb 7, 2015
Messages
25
Reaction score
0
People wanted to know how I can to put this script over 14 sqm. Pq when I try to put distance = 20, the doll on and fall on the floor and all around black. How do i get this, can anyone help use tfs 0.4.

local config = {
catapults = {
--[actionid] = "direção",
[6801] = "sul",
[6802] = "norte",
[6803] = "leste",
[6804] = "oeste",
},
distance = 14,
directions = {
["norte"] = 0,
["leste"] = 1,
["sul"] = 2,
["oeste"] = 3,
},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if config.distance % 2 ~= 0 then
return doPlayerSendCancel(cid, "Sorry, the catapult isn't available right now.") and print("Trade catapult distance for a odd number.")
elseif not config.catapults[item.actionid] then
return doPlayerSendCancel(cid, "Sorry, this catapult isn't available right now.") and print("Catapult without actionid or it isn't configured in table.")
end
local direction = config.directions[config.catapults[item.actionid]]
for i = 1, config.distance do
addEvent(function()
if getPlayerLookDir(cid) ~= direction then
doCreatureSetLookDirection(cid, direction)
end
local newPos = getPosByDir(i ~= 1 and getThingPos(cid) or toPosition, direction)
newPos.z = i <= config.distance / 2 and newPos.z - 1 or newPos.z + 1
if i < config.distance then
doAreaCombatHealth(0, 0, newPos, 0, 0, 0, 255)
doCreateItem(460, 1, newPos)
end
doTeleportThing(cid, newPos)
end, i * 120)
end
return true
end
 
Back
Top