roriscrave
Advanced OT User
- Joined
- Dec 7, 2011
- Messages
- 1,210
- Solutions
- 35
- Reaction score
- 206
I created a code where the player writes in a letter the vocation he wants to be.
but if player open a label, and write wrong vocation, it dont return false, it return error, exemple, if a player write "Sorqcerer".
Error is here, if text isnt a valid vocation, it dont return 'nil', it return error


LUA:
function onTextEdit(player, item, text)
if Vocation(text) then
player:setVocation(text)
else
--Vocation don't exist
return false
end
return true
end
but if player open a label, and write wrong vocation, it dont return false, it return error, exemple, if a player write "Sorqcerer".
Error is here, if text isnt a valid vocation, it dont return 'nil', it return error
LUA:
Vocation(text)

