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

monster lever

lopez65

Member
Joined
May 10, 2012
Messages
289
Solutions
1
Reaction score
14
Location
Barcelona
Hello friends I have got this script here in otland but it does not work for me my TFS is 1.4, if you can add 1 second of exhausted that would be great
and yes it may be possible to make as many monsters as the player wants

my errors in console with the current script

C++:
> palanca_rotwords.lua [error]
^ ...serv\data\scripts\actions\custom\palanca_rotwords.lua:11: unexpected symbol near '{'

Lua:
local config = {
    ["1"] = {n = 1},
}
 
function onTextEdit(cid, item, newText)
 
    if item.uid == 15000 and item.itemid == 9825 then -- add the unique id in the lever
    local x = config[newText]
        if x then
            for i = 1, x.n do
            local pos{x=1007, y=1026, z=7-- edit here the locations from the area they spawn in
                doSummonCreature("Rotworm", pos)-- name of monster you want here
            end
            doPlayerSendTextMessage(cid, 22, "1"..newText.." Rotworm spawned.")
        else
            doPlayerSendTextMessage(cid, 22, "You can only spawn 1 Rotworm at a time.")
        end
    end
    return true
end
 
C++:
Reloaded: scripts.
> palanca_rotwords.lua [error]
^ ...serv\data\scripts\actions\custom\palanca_rotwords.lua:11: unexpected symbol near '{'

my edit of line 11 ------>
Lua:
local pos{x=32339, y=32215, z=7}
 
C++:
Reloaded: scripts.
> palanca_rotwords.lua [error]
^ ...serv\data\scripts\actions\custom\palanca_rotwords.lua:11: unexpected symbol near '{'

my edit of line 11 ------>
Lua:
local pos{x=32339, y=32215, z=7}

----------
Lua:
local pos {x = 32339, y = 32215, z = 7 -- original
local pos {x = 32339, y = 32215, z = 7} -- edit
local pos = {x = 32339, y = 32215, z = 7} -- correct

Although none of this is tfs 1.0+ scripting.

tfs 1.0+ position
Lua:
local pos = Position(32339, 32215, 7)
 
Xikini thanks for the correction but now when i use the lever it shows no errors but does nothing

.uid == 15000 I put that in map editor in uid no aid
 
Last edited:
under actions.xml, do you have the UID registered? for example,
<action uniqueid="15000" event="script" value="custom/palanca_rotwords.lua"/>
 
Back
Top