• 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.X+ Looking for any exp statue script.

SalvaART

TriasOT.online
Joined
May 1, 2017
Messages
232
Solutions
1
Reaction score
139
Location
USA
Hello everyone!

I looking for a working exp statue script at TFS 1.2

Dura have something like this.

I want make a 50+ exp spots, the best edit is one file.

Thank you
 
If you mean exp boost for all players in-game, it's in this file on TFS 1.2:
You can set some global storage value to some value in exp statue script (ex. 'expiry date value') and then compare it in player.lua to add extra exp (ex. 20% = exp = exp * 1.2)) to all players as long as this statue is enabled.
 
If you mean exp boost for all players in-game, it's in this file on TFS 1.2:
You can set some global storage value to some value in exp statue script (ex. 'expiry date value') and then compare it in player.lua to add extra exp (ex. 20% = exp = exp * 1.2)) to all players as long as this statue is enabled.
Sorry its my bad, i looking for someone ex:

You can click right at statue, you recive exp like 100-1000.

After this ex. You discovered 1 from 50 exp statues.
 

Attachments

  • obraz_2024-10-27_074047252.webp
    obraz_2024-10-27_074047252.webp
    48.9 KB · Views: 30 · VirusTotal
I have no idea how they did the white text. xD
I only know how to do orange.

XML:
<action actionid="45001" script="experienceStatues.lua" />
<action actionid="45002" script="experienceStatues.lua" />

<action actionid="45049" script="experienceStatues.lua" />
<action actionid="45050" script="experienceStatues.lua" />
LUA:
local statueCountingStorage = 45000
local statues = {
--  [actionId] = {storageKey = xxxxx, experience = {min, max}},
    [45001] = {storageKey = 45001, experience = {100, 1000}},
    [45002] = {storageKey = 45002, experience = {100, 1000}},
   
    [45049] = {storageKey = 45049, experience = {100, 1000}},
    [45050] = {storageKey = 45050, experience = {100, 1000}}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local statue = statues[item:getActionId()]
   
    local storage = player:getStorageValue(statue.storageKey)   
    if storage == 1 then
        return true
    end
   
    local statueCount = math.max(player:getStorageValue(statueCountingStorage), 0) + 1
    player:setStorageValue(statueCountingStorage, statueCount)
    player:setStorageValue(statue.storageKey, 1)
   
    local experienceToAdd = math.random(statue.experience[1], statue.experience[2])
    player:addExperience(experienceToAdd, true)
   
    local totalStatueCount = 0
    for _ in pairs(statues) do
        totalStatueCount = totalStatueCount + 1
    end

    player:say("You discovered " .. statueCount .. " from " .. totalStatueCount .. " exp statues.", TALKTYPE_MONSTER_SAY, false, player, toPosition)
    return true
end
 
I have no idea how they did the white text. xD
I only know how to do orange.

XML:
<action actionid="45001" script="experienceStatues.lua" />
<action actionid="45002" script="experienceStatues.lua" />

<action actionid="45049" script="experienceStatues.lua" />
<action actionid="45050" script="experienceStatues.lua" />
LUA:
local statueCountingStorage = 45000
local statues = {
--  [actionId] = {storageKey = xxxxx, experience = {min, max}},
    [45001] = {storageKey = 45001, experience = {100, 1000}},
    [45002] = {storageKey = 45002, experience = {100, 1000}},
  
    [45049] = {storageKey = 45049, experience = {100, 1000}},
    [45050] = {storageKey = 45050, experience = {100, 1000}}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local statue = statues[item:getActionId()]
  
    local storage = player:getStorageValue(statue.storageKey)  
    if storage == 1 then
        return true
    end
  
    local statueCount = math.max(player:getStorageValue(statueCountingStorage), 0) + 1
    player:setStorageValue(statueCountingStorage, statueCount)
    player:setStorageValue(statue.storageKey, 1)
  
    local experienceToAdd = math.random(statue.experience[1], statue.experience[2])
    player:addExperience(experienceToAdd, true)
  
    local totalStatueCount = 0
    for _ in pairs(statues) do
        totalStatueCount = totalStatueCount + 1
    end

    player:say("You discovered " .. statueCount .. " from " .. totalStatueCount .. " exp statues.", TALKTYPE_MONSTER_SAY, false, player, toPosition)
    return true
end
Works brilliantly! Could I ask you to still add a message when I click on a statue again that it has already been received? Because at the moment there is no info, and I would really appreciate it, thanks
 
Works brilliantly! Could I ask you to still add a message when I click on a statue again that it has already been received? Because at the moment there is no info, and I would really appreciate it, thanks

Code:
34/50 exp statues have been located.
Code:
Discovered 13/50 exp statues!
  You gain 548 experience!

LUA:
local statueCountingStorage = 45000
local statues = {
--  [actionId] = {storageKey = xxxxx, experience = {min, max}},
    [45001] = {storageKey = 45001, experience = {100, 1000}},
    [45002] = {storageKey = 45002, experience = {100, 1000}},
  
    [45049] = {storageKey = 45049, experience = {100, 1000}},
    [45050] = {storageKey = 45050, experience = {100, 1000}}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local statue = statues[item:getActionId()]
  
    local storage = player:getStorageValue(statue.storageKey)
    local statueStorage = player:getStorageValue(statueCountingStorage)
   
    local totalStatueCount = 0
    for _ in pairs(statues) do
        totalStatueCount = totalStatueCount + 1
    end
   
    local statueText = statueCount .. "/" .. totalStatueCount .. " exp statues"

    if storage == 1 then
        player:say(statueText .. " have been located.", TALKTYPE_MONSTER_SAY, false, player, toPosition)
        return true
    end
  
    local statueCount = math.max(statueStorage), 0) + 1
    player:setStorageValue(statueCountingStorage, statueCount)
    player:setStorageValue(statue.storageKey, 1)
  
    local experienceToAdd = math.random(statue.experience[1], statue.experience[2])
    player:addExperience(experienceToAdd, true)
    player:say("Discovered " .. statueText .. "!\nYou gain " .. experienceToAdd .. " experience!", TALKTYPE_MONSTER_SAY, false, player, toPosition)
    return true
end
 
Code:
34/50 exp statues have been located.
Code:
Discovered 13/50 exp statues!
  You gain 548 experience!

LUA:
local statueCountingStorage = 45000
local statues = {
--  [actionId] = {storageKey = xxxxx, experience = {min, max}},
    [45001] = {storageKey = 45001, experience = {100, 1000}},
    [45002] = {storageKey = 45002, experience = {100, 1000}},
 
    [45049] = {storageKey = 45049, experience = {100, 1000}},
    [45050] = {storageKey = 45050, experience = {100, 1000}}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local statue = statues[item:getActionId()]
 
    local storage = player:getStorageValue(statue.storageKey)
    local statueStorage = player:getStorageValue(statueCountingStorage)
  
    local totalStatueCount = 0
    for _ in pairs(statues) do
        totalStatueCount = totalStatueCount + 1
    end
  
    local statueText = statueCount .. "/" .. totalStatueCount .. " exp statues"

    if storage == 1 then
        player:say(statueText .. " have been located.", TALKTYPE_MONSTER_SAY, false, player, toPosition)
        return true
    end
 
    local statueCount = math.max(statueStorage), 0) + 1
    player:setStorageValue(statueCountingStorage, statueCount)
    player:setStorageValue(statue.storageKey, 1)
 
    local experienceToAdd = math.random(statue.experience[1], statue.experience[2])
    player:addExperience(experienceToAdd, true)
    player:say("Discovered " .. statueText .. "!\nYou gain " .. experienceToAdd .. " experience!", TALKTYPE_MONSTER_SAY, false, player, toPosition)
    return true
end
Thank you for your time, everything works as it should! :) :) @Xikini
 
@Xikini today when i launch my local server i found this error:
Code:
[Warning - Event::checkScript] Can not load script: scripts/experienceStatues.lua
data/actions/scripts/experienceStatues.lua:29: unexpected symbol near ')'

line 29:
Code:
local statueCount = math.max(statueStorage), 0) + 1
 
@Xikini today when i launch my local server i found this error:
Code:
[Warning - Event::checkScript] Can not load script: scripts/experienceStatues.lua
data/actions/scripts/experienceStatues.lua:29: unexpected symbol near ')'

line 29:
Code:
local statueCount = math.max(statueStorage), 0) + 1
Remove additional ')' next to statueStorage variable.

LUA:
local statueCount = math.max(statueStorage, 0) + 1
 
Remove additional ')' next to statueStorage variable.

LUA:
local statueCount = math.max(statueStorage, 0) + 1
Thanks for your reply!

Next error after this change:
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/experienceStatues.lua:onUse
data/actions/scripts/experienceStatues.lua:22: attempt to concatenate global 'statueCount' (a nil value)
stack traceback:
[C]: in function '__concat'
data/actions/scripts/experienceStatues.lua:22: in function <data/actions/scripts/experienceStatues.lua:11>
 
Thanks for your reply!

Next error after this change:
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/experienceStatues.lua:onUse
data/actions/scripts/experienceStatues.lua:22: attempt to concatenate global 'statueCount' (a nil value)
stack traceback:
[C]: in function '__concat'
data/actions/scripts/experienceStatues.lua:22: in function <data/actions/scripts/experienceStatues.lua:11>
It means that it cannot merge string value on line 22:
LUA:
local statueText = statueCount .. "/" .. totalStatueCount .. " exp statues"

As you can see, totalStatueCount is already initialized earlier but the problem is with statueCount.
You have to initialize statueCount before that string merge.

Move and change without +1
LUA:
local statueCount = math.max(statueStorage, 0)

Before line
LUA:
local statueText = statueCount .. "/" .. totalStatueCount .. " exp statues"

Don't forget to add '+1' later when u save it in player's storage:
LUA:
player:setStorageValue(statueCountingStorage, statueCount+1)
 
LUA:
local statueCountingStorage = 45000
local statues = {
--  [actionId] = {storageKey = xxxxx, experience = {min, max}},
    [45001] = {storageKey = 45001, experience = {100, 1000}},
    [45002] = {storageKey = 45002, experience = {100, 1000}},
  
    [45049] = {storageKey = 45049, experience = {100, 1000}},
    [45050] = {storageKey = 45050, experience = {100, 1000}}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local statue = statues[item:getActionId()]
  
    local storage = player:getStorageValue(statue.storageKey)
    local statueStorage = player:getStorageValue(statueCountingStorage)
   
    local totalStatueCount = 0
    for _ in pairs(statues) do
        totalStatueCount = totalStatueCount + 1
    end
   
    local statueText = statueStorage .. "/" .. totalStatueCount .. " exp statues"

    if storage == 1 then
        player:say(statueText .. " have been located.", TALKTYPE_MONSTER_SAY, false, player, toPosition)
        return true
    end
  
    local statueCount = math.max(statueStorage, 0) + 1
    player:setStorageValue(statueCountingStorage, statueCount)
    player:setStorageValue(statue.storageKey, 1)
  
    local experienceToAdd = math.random(statue.experience[1], statue.experience[2])
    player:addExperience(experienceToAdd, true)
    player:say("Discovered " .. statueText .. "!\nYou gain " .. experienceToAdd .. " experience!", TALKTYPE_MONSTER_SAY, false, player, toPosition)
    return true
end
 

Xikini

Thanks for the Script

SalvaART

here talkactions It shows you how many statue you have completed
XML:
<talkaction words="!expstatues" script="expstatues.lua" />
LUA:
local statueCountingStorage = 45000
local statues = {
    [45001] = {storageKey = 45001, experience = {100, 1000}},
    [45002] = {storageKey = 45002, experience = {100, 1000}},
    [45049] = {storageKey = 45049, experience = {100, 1000}},
    [45050] = {storageKey = 45050, experience = {100, 1000}}
}

function onSay(player, words, param)
    local statueStorage = player:getStorageValue(statueCountingStorage) or 0
    local totalStatueCount = 0

    for _ in pairs(statues) do
        totalStatueCount = totalStatueCount + 1
    end
    
    local discoveredStatues = math.max(statueStorage, 0)
    local remainingStatues = totalStatueCount - discoveredStatues
    local message = "You have discovered " .. discoveredStatues .. " out of " .. totalStatueCount .. " statues. Remaining: " .. remainingStatues
    player:sendTextMessage(MESSAGE_INFO_DESCR, message)
    return true
end
 
Back
Top