OTcreator
Active Member
- Joined
- Feb 14, 2022
- Messages
- 425
- Solutions
- 1
- Reaction score
- 44
Hello.
I use this script in 0.3.7 on creaturescript and work fine.
How I can add this to TFS 1.4.2?
Events onPlayer? On creaturescripts not working.
I use this script in 0.3.7 on creaturescript and work fine.
How I can add this to TFS 1.4.2?
Events onPlayer? On creaturescripts not working.
Lua:
local titles = {
[0] = "Private",
[10] = "Huntsman",
[20] = "Ranger",
[40] = "Big Game Hunter",
[70] = "Trophy Hunter",
[100] = "Elite Hunter"
}
local rankStorage = 2500
function onLook(cid, thing, position, lookDistance)
if(isPlayer(thing.uid)) then
local rank = {rank = "Private", name = 0}
for k, v in pairs(titles) do
if(math.max(0, getPlayerStorageValue(thing.uid, rankStorage)) > k - 1) then
if(k - 1 > rank.name) then
rank.rank, rank.name = v, k - 1
end
end
end
doPlayerSetSpecialDescription(thing.uid, "\n Task rank: " .. rank.rank ..".")
end
return true
end