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

Quick help with a script pls ( tfs 1.3 )

Marko999x

ArchezOt soon
Premium User
Joined
Dec 14, 2017
Messages
3,974
Solutions
103
Reaction score
3,106
Location
Germany
Im trying to understand the system but im kinda lost

I have this part in the script
if player:getLevel() >= 30000 or player:getGroup() >= 3 then

Im trying to make it like
if someone is higher than group id 3 he doesnt need the 30k level but its not working
thats the problem..
what im doing wrong if I can ask
tfs 1.3
thanks

full script:
LUA:
local failPosition = Position(1186, 792, 7)

function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    if player:getLevel() >= 30000 or player:getGroup() >= 3 then
        return true
    end

    player:teleportTo(failPosition)
    failPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You need to be at least Level 30000 in order to pass.')
    return true
end
Post automatically merged:

problem solved
player:getGroup() >= 3 then to player:getGroup():getId() >= 3 then
 
Last edited:
Im trying to understand the system but im kinda lost

I have this part in the script
if player:getLevel() >= 30000 or player:getGroup() >= 3 then

Im trying to make it like
if someone is higher than group id 3 he doesnt need the 30k level but its not working
thats the problem..
what im doing wrong if I can ask
tfs 1.3
thanks

full script:
LUA:
local failPosition = Position(1186, 792, 7)

function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    if player:getLevel() >= 30000 or player:getGroup() >= 3 then
        return true
    end

    player:teleportTo(failPosition)
    failPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You need to be at least Level 30000 in order to pass.')
    return true
end
Post automatically merged:

problem solved
player:getGroup() >= 3 then to player:getGroup():getId() >= 3 then
U need to return the function true by ending the script to the players who have high group enter without permission of the level and u can use "or" because your script only execute the players who have level and it's ignoring the group permission
LUA:
local failPosition = Position(1186, 792, 7)

function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end
    if player:getLevel() >= 30000 or player:getGroup():getId() >= 3 then
    player:teleportTo(failPosition)
    else
     player:teleportTo(fromPosition)
     player:sendMagicEffect(CONST_ME_MAGIC_BLUE)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You need to be at least Level 30000 in order to pass or you are not in higher group.')
    return true
end
end
 
Last edited:
Back
Top