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

TFS 1.X+ Clean Houses

Raschu

New Member
Joined
Aug 2, 2011
Messages
69
Reaction score
1
Hi I loocking for script for cleaning houses, I mean if Vip time is finish then move out from house, I already check few scripts but does not work for tfs 1.2.

Thanks

Rasch
 
Lua:
house:setOwner(0)
You should now try to get the house from vip player and the above function will set the house to nobody and send every item inside that house to the player's depot.
 
You should make globalevent onStartUp (after each server restart) with checking if player got house and if player got VIP status.
 
I already try this one: but not working maby you be see what is wrong:
Lua:
    local houses = Game.getHouses()
    for i = 1, #houses do
        local house = houses[i]
        local owner = house:getOwnerGuid()
        if owner > 0 then
            local own = Player(owner)
            if own and not own:isVip() then
                house:setOwnerGuid(0)
            end
        end
    end
 
I already try this one: but not working maby you be see what is wrong:
Lua:
    local houses = Game.getHouses()
    for i = 1, #houses do
        local house = houses[i]
        local owner = house:getOwnerGuid()
        if owner > 0 then
            local own = Player(owner)
            if own and not own:isVip() then
                house:setOwnerGuid(0)
            end
        end
    end

I can't see nothing wrong in your script. Did you checked that the script is correctly installed into globalevents.xml and is in the right file inside of the data/globalevents/scripts directory?

The second thing I would try is: try changing this line:
Code:
house:setOwnerGuid(0)
Into
Code:
house:setOwner(0)

Like @Danger II suggested.
 
Back
Top