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

One-of-a-kind items.

bedlamos

New Member
Joined
Dec 11, 2018
Messages
24
Solutions
1
Reaction score
1
Location
USA
Hello xD

I can't quite figure out how to make an item one of a kind.
The inspiration is the Magic Longsword, or the Blessed Shield, which are extremely rare items.

In my server I want to hide mythical weapons that the players can find by exploring, or using logic, etc.
In practice I put a sword into a chest. When I take the sword out of the chest, save the server, and restart, the sword is back in the chest!

I tried putting a UID on the sword, but it just made the sword unmovable :/

Please help me! >.<"
 
Not sure what server you use, but in 0.3.7, I'd use a global storage value, so the item can only be gotten x amount of times, ever.
Lua:
if getGlobalStorageValue(45001) < 1 then
    setGlobalStorageValue(45001, 1)
    doPlayerAddItem(cid, itemid, count, true)
end
 
I use TFS 1.2
I'd really like the item to be on the map/can be seen by the player.
They pick up the item, and even after a server save/restart/etc. the item does not show back up on the map.
 
i'd probably use a globalevent that fires on startup to put the items on the map if it hasn't been picked up, and when you spawn the item, give it an attribute of uniqueItem or something, which you can then check for in the next part
to track if it's been picked up you could use the onItemMoved player event and set a global storage if it's been picked up, check for the attribute i mentioned above to determine if its unique
 
Back
Top