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

Lua Help me please ! CreatureScript script

rudy1002

New Member
Joined
Dec 31, 2014
Messages
7
Reaction score
0
Hello . I have a problem with this script and basically threw everything works but does not give credit to the console pops up the error

[ Error - CreatureScript Interface] data / creature / scripts / points.lua : onLogin description: ( luaGetCreatureName ) Creature not found




function onLogin(cid
)

local gstorage = getGlobalStorageValue(1750)
local name = getCreatureName(cid)
if getPlayerStorageValue(cid,2387) < 1 then
if (gstorage < 21) then
setGlobalStorageValue(1750, gstorage + 1)
doPlayerSetStorageValue(cid,2387, 1)
local gstorage2 = getGlobalStorageValue(1750)
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. 8 .. " WHERE `name` = '" .. getAccountByName(getCreatureName(name)) .. "' LIMIT 1;")
doBroadcastMessage("Gracz " .. name .. " zalogowal sie jako " .. gstorage2 .. " osoba! Jest w pierwszej 20 wiec dostaje 8 punktow do sms shopa! Gratulacje!")
end
end

return true
end
 
Last edited by a moderator:
Code:
function onLogin(cid)
     local gstorage = getGlobalStorageValue(1750)
     if getPlayerStorageValue(cid, 2387) < 1 then
         if gstorage < 21 then
             setGlobalStorageValue(1750, gstorage + 1)
             doPlayerSetStorageValue(cid, 2387, 1)
             db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + 8 WHERE `id` = " .. getPlayerAccountId(cid))
             doBroadcastMessage("Gracz " .. getCreatureName(cid) .. " zalogowal sie jako " .. getGlobalStorageValue(1750) .. " osoba! Jest w pierwszej 20 wiec dostaje 8 punktow do sms shopa! Gratulacje!")
         end
     end
     return true
end
 
Back
Top