• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Creaturescript won't let me login

Oneda

Aspiring Spriter
Joined
Dec 3, 2013
Messages
159
Solutions
2
Reaction score
104
Location
Brazil
Hi there. I got a problem with a REALLY SIMPLE script.
It's not lettin me login, not sure why, console won't show any errors.

Code:
function onLogin(cid)
local player = Player(cid)
    if getPlayerStorageValue(cid, 1337) == -1 then
        doPlayerAddSkillTry(player, 0, 50)
        setPlayerStorageValue(cid, 1337, 1)
    else
        return
    end
end

XML Tag being used:
Code:
    <event type="login" name="UnbugFist" script="unbug_fist.lua"/>

OBS: It won't let me login, but console shows my char connecting and disconnecting every time I try to connect.
 
That let me login with one char, but not with the other ones. Would that be because this one char wasnt ever logged before and as the other ones had already logged in, it's preventing them from login?

EDIT: Just realized that relogging on chars actually works.
Weird shit.

EDIT²: Recreated a character to test it again, it won't let new players to log-in, but if you try to log-in again (counts as the second login) it works. Any idea on how to fix this?
 
Last edited:
Remove or change return to return true.
Code:
else
    return

EDIT: Works fine for me, add this to your login.lua
Code:
    if player:getStorageValue(1337) == -1 then
        player:addSkillTries(0, 50)
        player:setStorageValue(1337, 1)
    end
 
Last edited:
I already did changed it to true. Read the topic above you :p, I changed it but it wont let the player login in the first try, only at the second try, no idea why tho.

Already tried removing the return too.
 
Change
Code:
function onLogin(cid)
local player = Player(cid)
    if getPlayerStorageValue(cid, 1337) == -1 then
        doPlayerAddSkillTry(player, 0, 50)
        setPlayerStorageValue(cid, 1337, 1)
    else
        return
    end
end

To:
Code:
function onLogin(cid)
    if getPlayerStorageValue(cid, 1337) == -1 then
        doPlayerAddSkillTry(cid, 0, 50)
        setPlayerStorageValue(cid, 1337, 1)
    end
    return true
end
 
Back
Top