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

TFS 0.X Making a new playable race

Zazeros

Member
Joined
Feb 13, 2012
Messages
72
Reaction score
17
0.4

Good morning guys, I'm trying to do something like this but I don't know where to begin.

I want a new race for players to create and play. But where can I make it?
I thought it would be easier to make as a new 'gender', like: Male, Female and Elf, for example.
Where can i edit it? Source?
If there is an easier way, please tell me.
Thank you.
 
you can code races as player sex, for example:
Code:
0 - human female
1 - human male
2 - elf female
3 - elf male
...

now you can declare and use a function to return the real player sex, like:
Code:
function getPlayerSex_new(cid)
    return getPlayerSex(cid) % 2
end

and just calling getPlayerSex_new(cid)

and if you want to get player race, you need to declare this:
Code:
function getPlayerRace(cid)
    return math.floor(getPlayerSex(cid) / 2)
end
 
if you divide 7 by 2, you get 3 + 1/2. % operation returns the top part of fraction (1/2) here
/ is just division symbol, for example 7 / 2 = 3.5
and floor is just rounding down, math.floor(6.5) = 6
 
Back
Top