armyman
Member
- Joined
- Feb 15, 2014
- Messages
- 318
- Reaction score
- 14
how i change this script to got the item with green letters? i got with white letters on screen
Text -> You have found... etc
Text -> You have found... etc
LUA:
function onUse(player, item, fromPosition, target, toPosition)
if item.uid <= 1250 or item.uid >= 20000 then
return false
end
local itemType = ItemType(item.uid)
if itemType:getId() == 0 then
return false
end
local itemWeight = itemType:getWeight()
local playerCap = player:getFreeCapacity()
if player:getStorageValue(item.uid) == -1 then
if playerCap >= itemWeight then
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. '.')
player:addItem(item.uid, 1)
player:setStorageValue(item.uid, 1)
else
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
end
else
player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.")
end
return true
end