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

Lua Script

Ward_214

Pro PvP
Joined
Dec 11, 2008
Messages
297
Reaction score
0
Can anyone tell me whats wrong w/ this script?

Code:
  local places = {
   ["temple"] = {position = {x=1052, y=1052, z=8}, level = 0},
   ["depot"] = {position = {x=96, y=118, z=7}, level = 0},
   ["hunting"] = {position = {x=90, y=119, z=7}, level = 0}
}
function onSay(cid, words, param)
    local tp = places[param]
    if (param == "") then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Write a position you want to be teleported to.")
    return TRUE
    end
 
  if getPlayerStorageValue(cid, prem) < 1 then
     doPlayerSendCancel(cid, "You must buy this command from idk yet.")
   return TRUE
 end
 if getPlayerLevel(cid) < tp.level then
    doPlayerSendCancel(cid, "Sorry,only players level " ..tp.level.. " can use this command.")
   return TRUE
 end
 if (hasCondition(cid, CONDITION_INFIGHT) == TRUE) then
    doPlayerSendCancel(cid, "Sorry, you have are pz'd")
   return TRUE
 end
 
 if getPlayerStorageValue(cid, 1156) == 1 then
    doTeleportThing(cid, tp.position)
    doSendMagicEffect(getPlayerPosition(cid), 10)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You teleported to ".. param .." !")
   return TRUE
 end
end
 
Code:
local places = {
   ["temple"] = {position = {x=1052, y=1052, z=8}, level = 0},
   ["depot"] = {position = {x=96, y=118, z=7}, level = 0},
   ["hunting"] = {position = {x=90, y=119, z=7}, level = 0}
}
function onSay(cid, words, param)
    local tp = places[param]
    if (param == "") then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Write a position you want to be teleported to.")
    return TRUE
    end
 
  if getPlayerStorageValue(cid, prem) < 1 then
     doPlayerSendCancel(cid, "You must buy this command from idk yet.")
   return TRUE
 end
 if getPlayerLevel(cid) < tp.level then
    doPlayerSendCancel(cid, "Sorry,only players level " ..tp.level.. " can use this command.")
   return TRUE
 end
 if (hasCondition(cid, CONDITION_INFIGHT) == TRUE) then
    doPlayerSendCancel(cid, "Sorry, you have are pz'd")
   return TRUE
 end
 
 if getPlayerStorageValue(cid, 1156) == 1 then
    doTeleportThing(cid, tp.position)
    doSendMagicEffect(getPlayerPosition(cid), 10)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You teleported to ".. param .." !")
   return TRUE
end
try.
 
I tried both, the new script and the configurable one, both have the same error but different lines.
It says:
Code:
'expected near' (to close 'function' at line 6) near '<eof>'

But I cant find anything that looks wrong on like 6. (Thats the script that Elaney helped). But on the other one, it has the same error, but line 1.

Can someone help?
 
Code:
local places = {
   ["temple"] = {position = {x=1052, y=1052, z=8}, level = 0},
   ["depot"] = {position = {x=96, y=118, z=7}, level = 0},
   ["hunting"] = {position = {x=90, y=119, z=7}, level = 0}
}
function onSay(cid, words, param)
    local tp = places[param]
    if (param == "") then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Write a position you want to be teleported to.")
end
    return TRUE
    end
 
  if getPlayerStorageValue(cid, prem) < 1 then
     doPlayerSendCancel(cid, "You must buy this command from idk yet.")
   return TRUE
 end
 if getPlayerLevel(cid) < tp.level then
    doPlayerSendCancel(cid, "Sorry,only players level " ..tp.level.. " can use this command.")
   return TRUE
 end
 if (hasCondition(cid, CONDITION_INFIGHT) == TRUE) then
    doPlayerSendCancel(cid, "Sorry, you have are pz'd")
   return TRUE
 end
 
 if getPlayerStorageValue(cid, 1156) == 1 then
    doTeleportThing(cid, tp.position)
    doSendMagicEffect(getPlayerPosition(cid), 10)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You teleported to ".. param .." !")
   return TRUE
end

try again.
 
Back
Top