A small scripting help needed

I cant even describe this problem. So here is what i do.

local cp= createCheckpoin(params)
table.insert(checkPoints,cp)

now, “cp” should be the checkpoint entity, however its just a number. How can i add the Entity itself to the table, so i can access it later?
now in table checkPoints the first value is 1. It should be the cp entity.

local cp= createCheckpoin(params)

Should that be;

local cp = CreateCheckpoint(params)

I know that, it was just an example that i mystyped.
local CP = CreateCheckpoint(1,checkPoints[number],checkPoints[number+1],checkPoints[number+2],checkPoints[number+3],checkPoints[number+4],checkPoints[number+5],10.0,255,0,0,120)
table.insert(cpTable,CP)
Citizen.Trace(CP)

This is the actual code, where CP is just a random “1” number. It should contain the CheckPoint entity.

Nobody? Its important for me, if you have any idea plz, i couldnt figure out a solution yet.

Nevermind, solved it, it actually returns a corrent handle, its just cant be handled like an entity, must use like SetCheckPointRGgba()

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.