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

Script for function onStepIn

gohamvsgoku

Member
Joined
Aug 21, 2017
Messages
151
Reaction score
9
Request for (Forgotten Server 1.2) script.

Hello
Im looking for a script onStepIn like this

if player walk in tile with uid of this script
player set to storage 100,1 and gain 100 of mana and 100 of health but only one time, if the player walk again nothing happens.
 
Solution
Lua:
function onStepIn(creature, item, position, fromPosition)

    local player = creature:getPlayer()
    if player == nil or player:isInGhostMode() then
        return true
    end

    local basehealth = player:getMaxHealth()
    local basemana = player:getMaxMana()
    if player:getStorageValue(100) < 1 then
        player:setMaxHealth(basehealth+100)
        player:setMaxMana(basemana+100)
        player:setStorageValue(100, 1)
    end

return true
end
Lua:
function onStepIn(creature, item, position, fromPosition)

    local player = creature:getPlayer()
    if player == nil or player:isInGhostMode() then
        return true
    end

    local basehealth = player:getMaxHealth()
    local basemana = player:getMaxMana()
    if player:getStorageValue(100) < 1 then
        player:setMaxHealth(basehealth+100)
        player:setMaxMana(basemana+100)
        player:setStorageValue(100, 1)
    end

return true
end
 
Solution
A question... example, how can i change this part

Lua:
player:setMaxHealth(basehealth+100
 player:setMaxMana(basemana+100)

Not regenerate a specifc value, but renerate full health and mana of the player?
 
Back
Top