#Help

58 messages · Page 1 of 1 (latest)

livid stream
#

That’s because it’s a replicated script, they will copy so once you stop the test it will not redirect you correctly. Just read the full name

#

I’m guessing cloud_148….Eat is the script

#

Just figure out what script that is

#

The compiler says that one is called “eat”, guessing that’s the tool activated one

#

Check line 3 for it

#

Odd, mind showing the blue lines in the compiler?

#

They tend to say the location of the error

#

It does say line 3

#

What is cloud_14834…?

#

Start a test, wait for the error, then click it

ebon sky
#

Its a plugin.

#

It lit is a plugin..

livid stream
ebon sky
#

But plugins usually have the name cloud

livid stream
ebon sky
#

Ye ppl always post about plugins in script help thinking its them

livid stream
ebon sky
#

See I just loaded a broken plugin.

#

Yea I went to toolbox and searched broken

#

Whats wrong with it

ebon sky
#

start by changing error to Error

#

error is like print but it throws an error and stop thread execution

#

it shouldnt be your issue there though

#

Can you change EatsV to Player.leaderstats.Eats

winter otter
#

have u tried in the actual game or just studio?

ebon sky
#

Do you have studio api access enabled

#

It should still work.

winter otter
#

try testing it in a local server test

#

sometimes the server shutdowns before the event fires

#

used to be the case sometimes at least

#

or u can try game:BindToClose()

ebon sky
#

i doubt its that

#

im too lazy to debug ur code

#
local Players = game:GetService("Players")
local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("Bacon")

local LeaderStats = Instance.new("Folder")
LeaderStats.Name = "leaderstats"

local Eats = Instance.new("IntValue")
Eats.Parent = LeaderStats
Eats.Name = "Eats"

local function GetData(Player)
    local PlayerStats = LeaderStats:Clone()
    PlayerStats.Parent = Player
    
    local Success, Data = pcall(function()
        return DataStore:GetAsync(Player.UserId)
    end)
    
    if Success then
        if Data then
            PlayerStats.Eats.Value = Data
        else
            PlayerStats.Eats.Value = 0
        end
    else
        Player:Kick("Data retrieval unsuccesful:", tostring(Data))
    end
end

local function SaveData(Player)
    local PlayerStats = Player:FindFirstChild("leaderstats")
    
    if PlayerStats and PlayerStats.Eats ~= nil then
        local Success, Error = pcall(function()
            DataStore:SetAsync(Player.UserId, PlayerStats.Eats.Value)
        end)
        
        if not Success then
            warn(Player.Name, Error)
        else
            print("Data saved for:", Player.Name)
        end
    end
end

Players.PlayerAdded:Connect(GetData)
Players.PlayerRemoving:Connect(SaveData)
dim hedgeBOT
#

studio** You are now Level 6! **studio

ebon sky
#

why not

#

did you try?

#

yeah its something with studio then

#

change the data

#

and see if it saves

#

change your eats

#

Your changing it on client..

#

It wont save

#

Change it from server.

#

Dawg

#

Click this.

#

Current: Client.

#

When you play test.

#

Then you will be able to modify things on the server.

#

🤦‍♂️

#

Indeed

#

All good