Hello guys, today I spend so much time on searching some information about it, but im lost…
I need correct connection string with number to execute function.
My tries:
local health1 = createConditionObject(CONDITION\_REGENERATION)setConditionParam(health1, CONDITION\_PARAM\_SUBID, 130) setConditionParam(health1, CONDITION\_PARAM\_BUFF, true) setConditionParam(health1, CONDITION\_PARAM\_TICKS, -1) setConditionParam(health1, CONDITION\_PARAM\_HEALTHGAIN, 150) function(player) local i = 1 local connect = "health"..tonumber(i) print(connect) -\> health1 doAddCondition(player, connect) end
So it’s ok, but when Im trying to execute function is says that condition “health1” not exist. But ofc it exist but idk why it not working.
I read smth about loadstring function but I don’t know how to correctly use it. Can someone help me in this?
Yours xsalon.
#Edit
I made smth like this, but it still says that condition not exist:
local health1 = createConditionObject(CONDITION\_REGENERATION) setConditionParam(health1, CONDITION\_PARAM\_SUBID, 130) setConditionParam(health1, CONDITION\_PARAM\_BUFF, true) setConditionParam(health1, CONDITION\_PARAM\_TICKS, -1) setConditionParam(health1, CONDITION\_PARAM\_HEALTHGAIN, 150) setConditionParam(health1, CONDITION\_PARAM\_HEALTHTICKS, 3000) function onSay(player) local player = tostring(player) local number = 1 loadstring('local cid = "'.. player ..'"; doAddCondition(cid, health'..number..')')() return true end
I tried like this too:
loadstring('local cid = "'.. player ..'"; doAddCondition(cid, "health'..number..'")')()
Still not working…
[1:33:00.646] [Error - TalkAction Interface]
[1:33:00.646] data/talkactions/scripts/test.lua:onSay
[1:33:00.646] Description:
[1:33:00.646] (luaDoAddCondition) Condition not found