reload script didn't save the data after rejoin

Started by Nihongo^, Sep 01, 2023, 06:37 PM

Previous topic - Next topic


Hi, i just tried this function to reload my script

but the problem is its wont save the data after the player rejoin
In this pic i killed my self after reload the script but it didn't save the data "death" in the database

P.S I only add onPlayerCommand, getOnlinePlayers,getPlayer(object)  and ignore the rest

"In main.nut"

Mohamed Boubekri

You need to explain more about your problem, and show us your onplayerdeath & onplayerpart functions.
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].


u can try use me reload script code(not raw reload)


I do Not recommand to use that function. It will cause bug.
Manually restarting would be best.
ps. Are you Japanese?


I have question. Do you change your content?

if maybe
please take your code to me
i need check it


I'll try to fix his instructions, see if I can help you. I added the onPlayerPart event to simulate the player quitting.
if (cmd == "reload") {
    local loaded = []
    foreach (v in getOnlinePlayers())
        if (getPlayer(v.ID) != null && getPlayer(v.ID).Spawned)
    for(local i=0;i<100;i++)
        local plr=FindPlayer(i);
    dofile("main.nut") // your main script.
    foreach (b in getOnlinePlayers()) {
    foreach (plr in loaded) {
        onPlayerRequestClass(plr, plr.Class, plr.Team, plr.Skin)
        if (plr.IsSpawned) onPlayerSpawn(plr)
    AnnounceAll("Reloaded.", 0)
    return 1;