Dran Ryszard
Member
Hi, i make script for onLook my upgrades on characters, but when i check normal player from god account, then i get error, when im look from normal player to god/normal player then its okey, only if God tried look normal player (when he look on self then its ok)
errors:
Lua:
local onLook_UPKI = EventCallback
function onLook_UPKI.onLook(player, thing, position, distance, description)
if thing:isPlayer() then
local check_AS = player:getStorageValue(CUSTOM.ATTACK_SPEED_UPGRADE)+1
description = string.format("%s\n[AS: %s/s]", description, check_AS)
end
return description
end
onLook_UPKI:register(2)
errors:
Code:
Lua Script Error: [Event Interface]
data/events/scripts/player.lua:Player@onLook
...TS\data\scripts\eventcallbacks\player\default_onLook.lua:44: attempt to index global 'player' (a nil value)
stack traceback:
[C]: in function '__index'
...TS\data\scripts\eventcallbacks\player\default_onLook.lua:44: in function 'callback'
...a\Desktop\ParcelOTS\data\scripts/lib\event_callbacks.lua:131: in function 'EventCallback'
data/events/scripts/player.lua:4: in function <data/events/scripts/player.lua:1>