Signup Now
Results 1 to 2 of 2
  1. #1
    Free User
    Join Date
    Nov 2014
    Posts
    10
    Reputation
    -1
    Rep Power
    0

    Check if player is standing in position

    So, atm I'm using this script

    init start
    local POSX, POSY = 33519, 32463 -- Position to place wild growth (POSX - POSY).
    local Rune = "wild growth rune" -- Name of Rune to shoot.
    local WildGrowthID = 2130 -- ID of placed Rune on ground (Wild Growth: 2130).
    init end

    auto(100)

    if topitem(POSX, POSY, $posz).id ~= WildGrowthID and itemcount(Rune) > 0 and (cooldown(SPELL_GROUP_ATTACK) == 0) AND topitem(POSX, POSY, $posz).id ~= player.id then
    settargeting("no")
    useitemon(Rune, 0, ground(POSX, POSY, $posz))
    wait(250)
    settargeting("yes")
    end

    It checks if there's a wildgrowth on the sqm, checks if it can throw it, and then does so.
    The problem is the
    "topitem(POSX, POSY, $posz).id ~= player.id", it throws a bug.

    So my question is, how do I check if a player is standing on an SQM ?

  2. #2
    Free User Donatello's Avatar
    Join Date
    Dec 2013
    Location
    Tuscany, Italy
    Posts
    398
    Reputation
    51
    Rep Power
    21
    On that case you should use iscreatureontile(), here's a working code:
    init start
    local posX, posY, posZ = 33519, 32463, $posz
    local runeName = "wild growth rune"
    local wgID = 2130
    init end

    auto(200) dontlist()
    if topitem(posX, posY, posZ).id ~= wgID and not iscreatureontile(posX, posY, posZ, "any") then
    if itemcount(runeName) > 0 and cooldown(SPELL_GROUP_ATTACK) == 0 then
    settargeting("off")
    useitemon(runeName, 0, ground(posX, posY, posZ)) waitping()
    settargeting("on")
    end
    end

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •