#Someone help me please

56 messages · Page 1 of 1 (latest)

stray crane
#
    local userID = player.UserId
    local key = "Player_"..userID
    local Power = player.leaderstats.Power.Value
    local Cash = player.leaderstats.Cash.Value
    local Rebirths = player.leaderstats.Rebirths.Value```
The second line errors
#

@still barn Could u help me with this

#

Ima dm u the full code

#

nvm I cant

#

ServerScriptService.PlayerData:71: attempt to index nil with 'UserId' - Server - PlayerData:71

still barn
#

just send the full code here

stray crane
#

71

still barn
#

you havent defined player in the script

#

put player into save parameters

stray crane
#

or does it only work on roblxo

still barn
#

yeah you have to pass in player to the save function or just define the player in the script

#

is the script a local script or normal script

stray crane
#

script

#

It doesnt save when I rejoin

still barn
#

are you using players.playeremoving to detect when a player leaves

#

and also using game.Close

still barn
#

are you passing in player to the save function

stray crane
#

yeah

still barn
#

are you loading the data when the player joins

stray crane
#

This

#

right

#

?

#

Players.PlayerAdded:Connect(setupPlayerData)

#

question

#

does it need to be a local script

#

or script

still barn
#

no

stray crane
#

becasue

still barn
#

it has to be a script

stray crane
#

Alr

#

In this Roblox Scripting Tutorial, we continue creating our Roblox Simulator! Today we go over saving Player Data using Data Stores from the Roblox API!

Subscribe for more Roblox Scripting Tutorials!

Join my Patreon to support me and gain access to the Scripts in this video! https://www.patreon.com/MonzterDEV

Download the Scripts from this v...

▶ Play video
still barn
#

im currently looking through the code rn

#

think i got it to work

stray crane
#

fr?

#

Bro u are the man if u did

still barn
#

change these lines to mine

stray crane
#

wait can u send me the full script because my lines might be different due to spacing

still barn
#

its in setupPlayerData

#

near the end of the function

stray crane
#

here?

stray crane
still barn
#

yeah change those value lines

stray crane
#

YO

#

IT WORKS

#

BRO

#

I WANT TO GIVE U A HUG RN

#

THANK YOU SO MUCH!

still barn
#

no problem

stray crane
#

I've been trying to fix it for like 1:30 hours

still barn
#

also please do not ping me