Caduceus
Unknown Member
- Joined
- May 10, 2010
- Messages
- 321
- Solutions
- 2
- Reaction score
- 24
I am trying to create a teleport with an item, example with a rune. that will teleport a player to the set pos. However I keep getting this error: data/actions/scripts/portal.lua:6: 'end' expected (to close 'function' at line 3) near 'doPlayerSendCancel' Please do not bash my scripting or tabbing, I know it is sub par.
LUA:
local pos = {x = 1013, y = 971, z = 4}
function onUse(cid, item, fromPosition, itemEx, toPosition)
return
getCreatureCondition(cid, CONDITION_INFIGHT)
doPlayerSendCancel(cid, "Sorry, you are in a fight.")
else
doCreateTeleport(5023, pos, getPlayerPosition(cid))
end
else
doPlayerSendCancel(cid, "You cannot use this item.")
end
return TRUE
end
Last edited: