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

Tfs 1.0 Attempt to call method remove < a nil value>

Xarly

Member
Joined
Mar 9, 2015
Messages
360
Reaction score
20
Hello guys well we have a problem on script exactly on this line
onUse
Attempt to call method remove < a nil value>
target:remove()

tried using
doRemoveCreature(target) but its not removing the monster >.<
if someonecan help!
 
Last edited:
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if not target:isMonster() then
        return false
    end
   
    if target:getName():lower() ~= "damaged crystal golem" then
        return false
    end
   
    if player:getStorageValue(Storage.BigfootBurden.GolemCount) > 4 or player:getStorageValue(Storage.BigfootBurden.MissionTinkersBell) ~= 1 then
        return false
    end
   
    player:setStorageValue(Storage.BigfootBurden.GolemCount, math.max(1, player:getStorageValue(Storage.BigfootBurden.GolemCount)) + 1)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The golem has been returned to the gnomish workshop.")
    target:remove()
    toPosition:sendMagicEffect(CONST_ME_POFF)
    return true
end
 
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if not target:isMonster() then
        return false
    end
  
    if target:getName():lower() ~= "damaged crystal golem" then
        return false
    end
  
    if player:getStorageValue(Storage.BigfootBurden.GolemCount) > 4 or player:getStorageValue(Storage.BigfootBurden.MissionTinkersBell) ~= 1 then
        return false
    end
  
    player:setStorageValue(Storage.BigfootBurden.GolemCount, math.max(1, player:getStorageValue(Storage.BigfootBurden.GolemCount)) + 1)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The golem has been returned to the gnomish workshop.")
    target:remove()
    toPosition:sendMagicEffect(CONST_ME_POFF)
    return true
end
thanks printer , one thing only how can make a item for each use get + 1 id ? on tfs 1.0?
 
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if not target:isMonster() then
        return false
    end

    if target:getName():lower() ~= "damaged crystal golem" then
        return false
    end

    if player:getStorageValue(Storage.BigfootBurden.GolemCount) > 4 or player:getStorageValue(Storage.BigfootBurden.MissionTinkersBell) ~= 1 then
        return false
    end

    player:setStorageValue(Storage.BigfootBurden.GolemCount, math.max(1, player:getStorageValue(Storage.BigfootBurden.GolemCount)) + 1)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The golem has been returned to the gnomish workshop.")
    target:remove()
    toPosition:sendMagicEffect(CONST_ME_POFF)
    return true
end
printer your script its not working im using tfs 1.0 not 1.1 >.< u gived me with functions of 1.1 >.<
so i need exactly help with function target:remove and getName >.< for tfs 1.0
@Limos can u help me with this 2 functions mate? thanks
 
Last edited:

Similar threads

Back
Top