-
Rintintin
- Posts: 55
- Joined: Tue Jan 01, 2013 7:45 am
- Location: Germany
#1
Post
by Rintintin »
As meentioned on
https://www.solarstrike.net/wiki/index. ... _Functions
there should be a function to update the buffs of a player or target. But this does not work (anymore)
Code: Select all
for k,v in pairs (player.Buffs) do
if v.Id ~= 503827 then goto continue end
print (v.Name.." "..v.Count)
::continue::
end
This code will return the desired buffs but no updates afterwards.
-
Administrator
- Site Admin
- Posts: 5341
- Joined: Sat Jan 05, 2008 4:21 pm
#2
Post
by Administrator »
You may need to call
first. I'm not sure exactly what you are attempting to do, so I think that function isn't automatically called for you in your circumstances.
That would look something like...
Code: Select all
player.updateBuffs()
for k,v in pairs (player.Buffs) do
if v.Id ~= 503827 then goto continue end
print (v.Name.." "..v.Count)
::continue::
end
-
Rintintin
- Posts: 55
- Joined: Tue Jan 01, 2013 7:45 am
- Location: Germany
#3
Post
by Rintintin »
Well I tried the command from the commandline but it threw an error
Code: Select all
player.updateBuffs()
onLoad error: D:/rombot/scripts/rom/classes/pawn.lua:429: attempt to index local 'self' (a nil value)
-
Administrator
- Site Admin
- Posts: 5341
- Joined: Sat Jan 05, 2008 4:21 pm
#4
Post
by Administrator »
Sorry, my mistake. That should have been a colon (:) instead of dot (.):
-
Rintintin
- Posts: 55
- Joined: Tue Jan 01, 2013 7:45 am
- Location: Germany
#5
Post
by Rintintin »
Oh yes, that does the trick and seems to work.