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

Windows [Error - GlobalEvent Interface]

Protegy

Luminiferous Aether
Joined
May 15, 2011
Messages
216
Reaction score
9
Location
America
I have no clue what the problem is here...


[22/07/2011 06:18:42] [Error - GlobalEvent Interface]
[22/07/2011 06:18:42] data/globalevents/scripts/weaponCheck.lua: onThink
[22/07/2011 06:18:42] Description:
[22/07/2011 06:18:42] data/globalevents/scripts/weaponCheck.lua:5: attempt to call global 'getItemAttackSpeed' (a nil value)
[22/07/2011 06:18:42] stack traceback:
[22/07/2011 06:18:42] data/globalevents/scripts/weaponCheck.lua:5: in function <data/globalevents/scripts/weaponCheck.lua:1>
[22/07/2011 06:18:42] [Error - GlobalEvents::think] Couldn't execute event: weaponCheck


To the people that help, thank you for your time. :peace:
 
Code:
function getItemAttackSpeed(itemid)
    return getItemInfo(itemid).attackSpeed
end

do note that this function will return 0 if the item doesn't have an attackSpeed(meaning its using the regular vocation attack speed)

Rep+ if I helped :)
 
I'm using TFS 0.3.6 > I'm trying to create an item that can be used by players to increase the attack speed for x amount of time. Any suggestions? :peace:
 
well, you dont need to get the attackspeed of the item as i guess all item have same speed, so you just use
Lua Code:

doItemSetAttribute(uid,"attackspeed",speed) --- speed starts from 1 (fastest) to 1999(slowest), 2000 is the default i guess.
 
[22/07/2011 07:54:51] [Error - Action Interface]
[22/07/2011 07:54:51] data/actions/scripts/buffs/pally.lua:eek:nUse
[22/07/2011 07:54:51] Description:
[22/07/2011 07:54:51] data/actions/scripts/buffs/pally.lua: 20: attempt to call global 'setItemAttackSpeed' (a nil value)
[22/07/2011 07:54:51] stack traceback:
[22/07/2011 07:54:51] data/actions/scripts/buffs/pally.lua: 20: in function 'addBuff'
[22/07/2011 07:54:51] data/actions/scripts/buffs/pally.lua: 46: in function <data/actions/scripts/buffs/pally.lua:5>

Not a clue...
 
I think that wasnt what i told you about, i told you to use doItemSetAttribute , as you dont have the other function obviously.
 
I think that wasnt what i told you about, i told you to use doItemSetAttribute , as you dont have the other function obviously.

What function am I missing? If it's the pally.lua you're talking about I do have it. Do you have msn? I'd like to talk about it a bit more in depth if that's okay with you. :peace:
 
replace the line(s) containing setItemAttackSpeed with the function he mentioned, while preserving the old variables?
 
[22/07/2011 13:09:36] [Error - GlobalEvent Interface]
[22/07/2011 13:09:36] data/globalevents/scripts/weaponCheck.lua:eek:nThink
[22/07/2011 13:09:36] Description:
[22/07/2011 13:09:36] data/lib/050-function.lua:665: attempt to index a boolean value
[22/07/2011 13:09:36] stack traceback:
[22/07/2011 13:09:36] data/lib/050-function.lua:665: in function 'getItemAttackSpeed'
[22/07/2011 13:09:36] data/globalevents/scripts/weaponCheck.lua:5: in function <data/globalevents/scripts/weaponCheck.lua:1>
[22/07/2011 13:09:36] [Error - GlobalEvents::think] Couldn't execute event: weaponCheck


Now what?
 
PHP:
function onThink(interval, lastExecution, thinkInterval)
for _, pid in ipairs(getPlayersOnline()) do
weapon = getPlayerWeapon(pid)
if weapon.uid > 0 then
    if getPlayerStorageValue(pid, 1987) <= 0 and getItemAttackSpeed(getPlayerWeapon(pid).uid) > 0 then
			setItemAttackSpeed(getPlayerWeapon(pid).uid, 0)
			doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_ORANGE, "Weapon Speed: Normal")

    end
end
end
return true
end




That's the weaponCheck.lua
 
Back
Top