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

Stamina Doll, Frag remover, Events, New spells

Tamiko

Member
Joined
Sep 1, 2014
Messages
24
Reaction score
0
Hello

Dear whoever is gonna read this. I really need new scrips for TFS 0.2.15
1. Stamina doll -
Someone is gonna find it on Quest click on it and get full stamina
2. Frag doll - to remove frags, red skull, black skull
3. I want to make Events, like monsters are coming to this and this city, kill as many as you can and whoever kills the most gets points from item store.. or experience or something like that
4. I also need really much new spells. like exura gran ico and so on for some reason they are missing in this server

It is not like I havent been looking on this forum. I actually recently checked many posts before I made this thread, so please do not hate me :p

pretty please!
Tamiko
 
Hello there,
Yes I tried the one with stamina-refill just before writing this thread, sadly it did not work .

About Frag remover was pretty much the same
Code:
[C]: in function 'getCreatureSkullType'
data/actions/scripts/skull.lua:2: in function <data/actions/scripts/skull.lua:1>
 
Event:
Creaturescript
Code:
<event type="kill" name="Killevent" script="killevent.lua"/>

login.lua
Code:
registerCreatureEvent(cid, "Killevent")

killevent.lua
Code:
local monsters, storage = {"rat", "cave rat"}, 73873

function onKill(cid, target)

     if isInRange(getPlayerPosition(cid), {x = 70, y = 100, z = 7}, {x = 120, y = 150, z = 7}) then
         for m = 1, #monsters do
             if getCreatureName(target):lower() == monsters[m] then
                 if getPlayerStorageValue(cid, storage) == -1 then
                     setPlayerStorageValue(cid, storage, 0)
                 end
                 setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Total event kills: "..getPlayerStorageValue(cid, storage)..".")
             end
         end
     end
     return true
end

Globalevent
Code:
<globalevent name="Raid" time="16:00:00" script="raid.lua"/>

Code:
local storage, max = 73873, 0

local monsters = {
   {name = "Rat", pos = {x = 89, y = 126, z = 7}},
   {name = "Rat", pos = {x = 90, y = 126, z = 7}},
   {name = "Rat", pos = {x = 91, y = 126, z = 7}},

   {name = "Rat", pos = {x = 89, y = 127, z = 7}},
   {name = "Rat", pos = {x = 90, y = 127, z = 7}},
   {name = "Rat", pos = {x = 91, y = 127, z = 7}},
   {name = "Rat", pos = {x = 92, y = 127, z = 7}},
   {name = "Rat", pos = {x = 93, y = 127, z = 7}},

   {name = "Rat", pos = {x = 89, y = 128, z = 7}},
   {name = "Rat", pos = {x = 90, y = 128, z = 7}},

   {name = "Cave Rat", pos = {x = 89, y = 129, z = 7}},
   {name = "Cave Rat", pos = {x = 90, y = 129, z = 7}},
   {name = "Cave Rat", pos = {x = 91, y = 129, z = 7}},
   {name = "Cave Rat", pos = {x = 92, y = 129, z = 7}}
}

local function getHighestStorageValueOnline(storage)
     local players = getOnlinePlayers()
     for x = 1, #players do
         local result = getPlayerStorageValue(getPlayerByName(players[x]), storage)
         if result > max then
             max = result
             player = getPlayerByName(players[x])
         end
     end
     if player then
         return player
     end
end

local function doGiveRaidReward()
     if getHighestStorageValueOnline(storage) then
         broadcastMessage("Event ended, the winner is "..getPlayerName(player).." with "..max.." kills.")
         doPlayerAddItem(player, 2112, 1)
         doTeleportThing(player, {x = 94, y = 115, z = 7})
     end
     local resetPlayer = getOnlinePlayers()
     for r = 1, #resetPlayer do
         setPlayerStorageValue(getPlayerByName(resetPlayer[r]), storage, 0)
     end
     max = 0
     return true
end

function onTime(interval)

     local spec = getSpectators({x = 91, y = 127, z = 7}, 5, 5, false)
     if spec ~= nil then
         for _, s in pairs(spec) do
             n = getCreatureName(s):lower()
             if n == "rat" or n == "cave rat" then
                 return true
             end
         end
     end
     for m = 1, #monsters do
         doSummonCreature(monsters[m].name, monsters[m].pos)
     end
     broadcastMessage("Raid event started.")
     addEvent(doGiveRaidReward, 2 * 60 * 60 * 1000)
     return true
end
 
Last edited:
Could you please specify all places that I need to change in different color im so lost :eek:
I mean what things I should change in killevent.lua and Globalevent raid.lua

I mean for what I can change it exactly to not bug the server and what possibilities i have

pretty please :3:oops:
 
Add this in creaturescripts. The first line should be in creaturescripts.xml, the second line in login.lua. The killevent script should be a new Lua script you add in the folder scripts in creaturescripts.
Creaturescript
Code:
<event type="kill" name="Killevent" script="killevent.lua"/>

login.lua
Code:
registerCreatureEvent(cid, "Killevent")

killevent.lua
Code:
local monsters, storage = {"rat", "cave rat"}, 73873

function onKill(cid, target)

     if isInRange(getPlayerPosition(cid), {x = 70, y = 100, z = 7}, {x = 120, y = 150, z = 7}) then
         for m = 1, #monsters do
             if getCreatureName(target):lower() == monsters[m] then
                 if getPlayerStorageValue(cid, storage) == -1 then
                     setPlayerStorageValue(cid, storage, 0)
                 end
                 setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Total event kills: "..getPlayerStorageValue(cid, storage)..".")
             end
         end
     end
     return true
end

Add this in globalevent, the first line is the line in globalevents.xml, the raid.lua script should be a new Lua script in the folder scripts in globalevents.
Globalevent
Code:
<globalevent name="Raid" time="16:00:00" script="raid.lua"/>

Code:
local storage, max = 73873, 0

local monsters = {
   {name = "Rat", pos = {x = 89, y = 126, z = 7}},
   {name = "Rat", pos = {x = 90, y = 126, z = 7}},
   {name = "Rat", pos = {x = 91, y = 126, z = 7}},

   {name = "Rat", pos = {x = 89, y = 127, z = 7}},
   {name = "Rat", pos = {x = 90, y = 127, z = 7}},
   {name = "Rat", pos = {x = 91, y = 127, z = 7}},
   {name = "Rat", pos = {x = 92, y = 127, z = 7}},
   {name = "Rat", pos = {x = 93, y = 127, z = 7}},

   {name = "Rat", pos = {x = 89, y = 128, z = 7}},
   {name = "Rat", pos = {x = 90, y = 128, z = 7}},

   {name = "Cave Rat", pos = {x = 89, y = 129, z = 7}},
   {name = "Cave Rat", pos = {x = 90, y = 129, z = 7}},
   {name = "Cave Rat", pos = {x = 91, y = 129, z = 7}},
   {name = "Cave Rat", pos = {x = 92, y = 129, z = 7}}
}

local function getHighestStorageValueOnline(storage)
     local players = getOnlinePlayers()
     for x = 1, #players do
         local result = getPlayerStorageValue(getPlayerByName(players[x]), storage)
         if result > max then
             max = result
             player = getPlayerByName(players[x])
         end
     end
     if player then
         return player
     end
end

local function doGiveRaidReward()
     if getHighestStorageValueOnline(storage) then
         broadcastMessage("Event ended, the winner is "..getPlayerName(player).." with "..max.." kills.")
         doPlayerAddItem(player, 2112, 1)
         doTeleportThing(player, {x = 94, y = 115, z = 7})
     end
     local resetPlayer = getOnlinePlayers()
     for r = 1, #resetPlayer do
         setPlayerStorageValue(getPlayerByName(resetPlayer[r]), storage, 0)
     end
     max = 0
     return true
end

function onTime(interval)

     local spec = getSpectators({x = 91, y = 127, z = 7}, 5, 5, false)
     if spec ~= nil then
         for _, s in pairs(spec) do
             n = getCreatureName(s):lower()
             if n == "rat" or n == "cave rat" then
                 return true
             end
         end
     end
     for m = 1, #monsters do
         doSummonCreature(monsters[m].name, monsters[m].pos)
     end
     broadcastMessage("Raid event started.")
     addEvent(doGiveRaidReward, 2 * 60 * 60 * 1000)
     return true
end
 
Last edited:
I mean things in actuall scripts
PHP:
if isInRange(getPlayerPosition(cid), {x = 70, y = 100, z = 7}, {x = 120, y = 150, z = 7}) then
and so on
 
That's the position where the players should kill the monsters.
First position is left upper corner, second position is right lower corner.
 
Back
Top