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

how to get player CID?

Joined
Mar 14, 2020
Messages
139
Solutions
3
Reaction score
11
I have: Name and Id, how do i get the CID from this?

I need to construct a player with local newPlayer = Player() but i dont have CID to do that :/ and just ID or name dosn't work :/
 
"cid" is Creature ID, what creature:getId() returns. Idk why people use cid instead of pid when working with Player class but whatever.
Both Player("name") and Player(id) can be used to get Player. If it returns nil then player wasn't found.
Player(id or guid or name or userdata)
 
I have: Name and Id, how do i get the CID from this?

I need to construct a player with local newPlayer = Player() but i dont have CID to do that :/ and just ID or name dosn't work :/
Where will you get the player? What context it is? Because practically all functions pass userdata as parameter.
 
Where will you get the player? What context it is? Because practically all functions pass userdata as parameter.
I want to give a storage for a player:

Context:
Player 1 make one action and give player 2 a storage to do something
Player 2 with that storage now can do the thing.
Post automatically merged:

didn't get it hmmmm
 
I want to give a storage for a player:

Context:
Player 1 make one action and give player 2 a storage to do something
Player 2 with that storage now can do the thing.
Post automatically merged:


didn't get it hmmmm
Ok, but what event you pretend do that? Is it an Actions? CreatureEvent? In which situation will ocorrur that
 
It should be mentioned that this can only be done in TFS 1.0+
Lua:
local player = Player("Test")
if player then
print(player:getId())
end

The ID is a temporary number that only works as a reference to the player during its life, once the player is deleted from memory then this ID no longer works, if you need to obtain the same player it is always better to use his name or the GUID
 
Back
Top