#help me pls

103 messages · Page 1 of 1 (latest)

faint leaf
#

For the future, format your code like this:

#
local DataStoreService = game:GetService("DataStoreService")
local characterDataStore = DataStoreService:GetDataStore("CharacterDataStore")
local inventoryDataStore = DataStoreService:GetDataStore("InventoryDataStore")

local function deleteCharacterData(player)
    local userId = player.UserId
    local success, errorMessage = pcall(function()
        characterDataStore:RemoveAsync("character" .. userId)
        inventoryDataStore:RemoveAsync("inventory" .. userId) -- Remove inventory data
    end)
    if success then
        print("Character data and inventory for player " .. player.Name .. " have been deleted.")

        -- Add a flag to prevent the character from coming back
        characterDataStore:SetAsync("characterdeleted" .. userId, true)
    else
        warn("Failed to delete character data and inventory for player " .. player.Name .. ": " .. errorMessage)
    end
end

-- Example usage: Call this function when a player decides to delete their character
game.Players.PlayerRemoving:Connect(deleteCharacterData)
placid mural
#

so whats the problem tho

placid mural
faint leaf
#

Lookin' for it right now-- I just reposted the code so I could read it

sly summitBOT
#

studio** You are now Level 9! **studio

faint leaf
# placid mural ok thank you

After looking through the video and seeing that none of the debug messages printed, I don't think this section of the code ever got ran. Can you post your UnitStats script?

placid mural
#

if you can guide

#

me

faint leaf
placid mural
#

@faint leaf whh one

faint leaf
#

I know nothing about this game 💀

#

But from the sounds of it, look somewhere in StarterGui?

placid mural
#

THIS ONE

#

?

#

this is the player script loader

faint leaf
# placid mural

Nope, not this one. Click on the error while the game is running and it'll take you to the file

#

It needs to have at least 11 lines

placid mural
#

this error?

#

btw this is the starter gui

#

i think itz this one

#

full code

faint leaf
#

If you click here, it'll take you right to it:

placid mural
#

which one in there?

faint leaf
#

Click inside of statFrame

placid mural
#

got it

sly summitBOT
#

studio** You are now Level 3! **studio

faint leaf
#

Let me see the full thing uncropped

placid mural
#

this a whole lotta script

faint leaf
#

I bet

placid mural
faint leaf
placid mural
#

if i post the script on discord

faint leaf
#

It's probably too long lol

placid mural
faint leaf
#

Yep, that looks right

placid mural
#

ik how im gonna do it

#

imma make a baseplate

#

and let u edit it

#

the code

fallow wing
placid mural
faint leaf
#

Bro please no

placid mural
faint leaf
#

Right click the file > Save to file

placid mural
#

and then

#

i did it

#

save it

faint leaf
#

Upload it here

placid mural
#

there u go

fallow wing
#

do you have this setting enabled

placid mural
#

how do i check

placid mural
fallow wing
placid mural
#

yep

fallow wing
#

and have you tried playing the game in roblox and not in studio?

#

just to make sure

placid mural
placid mural
#

@faint leaf

faint leaf
#

Ok, so 2 things

#

Firstly, I screwed up

#

Secondly, try deleting the p

placid mural
#

screwed up?

faint leaf
#

in line 11

placid mural
#

show me an example

faint leaf
#

Changing script.Parent.MouseButton1Click:Connect(function(p) to script.Parent.MouseButton1Click:Connect(function()

#

Delete this message

placid mural
#

ok

faint leaf
#

My mistake was that Right click -> save to file didn't save the script...

#

IT SAVED THE ENTIRE GAME

placid mural
#

the character is still there):

#

it deletes

#

but when i rejoin

#

the character is there

faint leaf
#

Does the error go away?

placid mural
#

no

#

iprinted this tho

#

@faint leaf

faint leaf
sly summitBOT
#

studio** You are now Level 4! **studio

placid mural
#

@faint leaf

#

which part

faint leaf
#

So I spent some time looking around the code, and I saw the errors I came across didn't really look like errors one could accidentally make. For instance, almost every script had a p in the function's parameters, and the missing underscores didn't seem like a silly mistake either

#

So I just want to ask-- did anything happen before coming here?

#

This seems more intentional than accidental

placid mural
#

i came here for help

#

mfriend did the script

#

and im fixing it

#

but its just so weird