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

Solved Is there anyway to get the player's summon?

Raiden

Developer
Joined
Sep 16, 2008
Messages
486
Reaction score
32
Location
Venezuela
Hello, well, i update my server distro to the lastest TFS 1.0, but i'm getting a little bit crazy with the new functions, and i cannot figure out how get the summons of a player, i explain myself, i want that when someone is in X area he cannot summon any monster, and if he summon a monster and then enter to the area i want that summon to dissappear, okay, i'm not a beginner, i know how to do the area thing and those things, BUT, the part to make the summon to dissappear, that's what i don't figure out how to, i tried the function creature:remove() but i can't get the player summon (i tried too with creature:getSummons()) but that only return a number and not the summoned monster itself, so how i can do?, what fucntion i need to use?

I explain myself?
 
Code:
    local player = Player(cid)
    local summons = player:getSummons()
    if #summons > 0 then
        for i = 1, #summons do
            summons[i]:remove()
        end
    end
 
@Ninja
Is there a reason why you create a userdata object again from the id you get from a userdata object? Couldn't you just call remove?
 
@Ninja
Is there a reason why you create a userdata object again from the id you get from a userdata object? Couldn't you just call remove?
I don't know what I was thinking this morning but you're right and I edited my previous post. :p
 
Back
Top