• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

TFS 1.3 Script Help

Marko999x

ArchezOt soon
Premium User
Joined
Dec 14, 2017
Messages
3,974
Solutions
104
Reaction score
3,108
Location
Germany
Hey
I need quick help with my script..
For some reasons it always shows "You have been rewarded with scorpion king instead of "You alredy found scorpion king"
I do not have any experience in Lua thats why im asking for help
Script:
LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(60001) == -1 then
        player:addMount(21)
        player:setStorageValue(60002, 1)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have been rewarded with Scorpion King.')
        else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You alredy found Scorpion King.')
    end
    return true
end

If im not wrong it used to work like this in TFS 0.4
Using TFS 1.3
I do not have any errors in Console
 
Solution
LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(60001) < 1 then
        player:addMount(21)
        player:setStorageValue(60001, 1)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have been rewarded with Scorpion King.')
        else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You alredy found Scorpion King.')
    end
    return true
end

Try this
LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(60001) < 1 then
        player:addMount(21)
        player:setStorageValue(60001, 1)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have been rewarded with Scorpion King.')
        else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You alredy found Scorpion King.')
    end
    return true
end

Try this
 
Solution
Back
Top