• 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 0.3.5] Help to get this script working

Stormoguden

Professional Mapper~
Joined
Nov 3, 2008
Messages
442
Reaction score
6
Location
Sweden/Stockholm
Code:
local LeverPos      = { x = 1037, y = 1148, z = 8} -- Lever Position
local timeToRemove  = 40 -- Time before quest reset

function onUse(cid, item, frompos, item2, topos)

        if item.itemid == 1945 then
                local player1pos = {x=1037, y=1147, z=8, stackpos=253} -- position of player 1
                local player1 = getThingfromPos(player1pos)

                local player2pos = {x=1037, y=1149, z=8, stackpos=253} -- position of player 2
                local player2 = getThingfromPos(player2pos)

                                local nplayer1pos = {x=1033, y=1146, z=11, stackpos=253} --- where player 1 will be teleported
                                local nplayer2pos = {x=1033, y=1148, z=11, stackpos=253} --- where player 2 will be teleported

                                doSendMagicEffect(player1pos,2)
                                doSendMagicEffect(player2pos,2)

                                doTeleportThing(player1.uid,nplayer1pos)
                                doTeleportThing(player2.uid,nplayer2pos)

                                doSendMagicEffect(nplayer1pos,10)
                                doSendMagicEffect(nplayer2pos,10)

            doPlayerSendTextMessage(cid,22,"You have entered the quest!") -- Message when the lever is pulled
            addEvent(doRemoveLever, timeToRemove * 1000)

	else

        doPlayerSendCancel(cid,"You need to be two players to do this quest.") -- message if the lever is pulled without having two players on their locations.

    else if item.itemid == 1946 then

        doPlayerSendCancel(cid,"The quest is already active.") -- message if the lever is pulled again.

    return TRUE

    end
end

end
 

function doRemoveLever() -- the remove trigger

local Lever = getTileItemById(LeverPos, 1946)

    if Lever.uid > 0 then

        doRemoveItem(Lever.uid)
        doTransformItem(Lever.uid, 1945)

    end
end

Okay I'm really new at lua scripting and I need help with this script to get it work. The reason why it's so fail is becouse I have no idea how to set up a script but I know how I want it. So please do me a favour and I will give you rep++

Help needed ASAP! Last thing I need to get my server going!
 
Should've told us what you want it to do atleast

It's like asking me to put together a ferrari enzo with lamborghini parts...

Well isnt it prery obvious reading the script? ;o

Well I will explain for you;

2 tiles 2 people must stand on - pull a lever - gets teleported to a new place - the lever resets after 15 minutes..
 
Back
Top