vexler222
Active Member
- Joined
- Apr 22, 2012
- Messages
- 715
- Solutions
- 15
- Reaction score
- 47
Hi, can someone tell me why this script printing everytime wrong? When i put good answer, still i got wrong in console.
(Im in area, script what check if player is in area working good)
(Im in area, script what check if player is in area working good)
Lua:
local answer = TalkAction("!as")
local function isInArena(player)
local pos = player:getPosition()
local rooms = {
[1] = {as = "t", rPos = {{x = 2850, y = 2133, z = 7},{x = 2865, y = 2146, z = 7}}},
[2] = {as = "", rPos = {{x = 2891, y = 2134, z = 7},{x = 2904, y = 2151, z = 7}}},
}
local room_x = player:getStorageValue(as.room)
if pos.z == rooms[room_x].rPos[1].z then
if pos.x >= rooms[room_x].rPos[1].x and pos.y >= rooms[room_x].rPos[1].y then
if pos.x <= rooms[room_x].rPos[2].x and pos.y <= rooms[room_x].rPos[2].y then
if param == rooms[room_x].as then
print("good")
else
print("wrong")
end
return true
end
end
end
player:sendTextMessage(MESSAGE_EVENT_DEFAULT,"Poff Poff")
return true
end
function answer.onSay(player, words, param)
isInArena(player)
end
answer:separator(" ")
answer:register()