Hi otlanders,
I'm using a script at an event, and it's spawning on top of objects as shown in the image:
Script:
I'm using a script at an event, and it's spawning on top of objects as shown in the image:
Script:
Lua:
function killPlayer(cid, pos, killer)
local t_l = SBW_AREA[1]
local b_r = SBW_AREA[2]
local posti = {}
local isPossibleToTeleportPlayer = false
while (isPossibleToTeleportPlayer == FALSE) do
doTeleportThing(cid, {x=math.random(t_l.x,b_r.x), y=math.random(t_l.y, b_r.y), z=math.random(t_l.z, b_r.z)})
if isInWallArray(posti) == FALSE then
isPossibleToTeleportPlayer = TRUE
end
end
doTeleportThing(cid, posti)
doSendMagicEffect(pos,2)
doSendMagicEffect(posti,6)
doSendAnimatedText(pos, ""..getCreatureName(killer).." ", 55)
doPlayerSendTextMessage(cid, 27, "Voce foi morto por "..getCreatureName(killer)..".")
doPlayerSetStorageValue(killer, SBW_SCORE, getPlayerStorageValue(killer, SBW_SCORE)+SBW_POINTSKILL)
doPlayerSendTextMessage(killer, 27, "You've killed "..getCreatureName(cid)..".")
if SBW_LOSTSCORE then
doPlayerSetStorageValue(cid, SBW_SCORE, getPlayerStorageValue(cid, SBW_SCORE)-1)
end
if SBW_RESETAMMO then
doPlayerSetStorageValue(cid, SBW_AMMO, SBW_MINAMMO)
end
end