Bl_nkDev
(Bl_nkDev)
April 1, 2024, 4:33pm
#1
What do you want to achieve? to make the script work
What is the issue? I have 0 clue I have read the script 3-4 times and I’m still new to scripting.
What solutions have you tried so far? not much
Here is the script:
local function setupPlayerData(player: player)
local userID = player.UserID
local key = “Player_”…userID
local leaderstats = Instance.new("Folder", player)
leaderstats.Name = "leaderstats"
local food = Instance.new("IntValue", leaderstats)
food.Name = "Food"
food.Value = 0
local coins = Instance.new("IntValue", leaderstats)
coins.Name = "Coins"
coins.Value = 0
local success, returnValue
success, returnValue = pcall(dataStore.GetAsync, dataStore, key)
print(returnValue)
Operatik
(Operatik)
April 1, 2024, 4:36pm
#2
The attribute is called UserId
and not UserID
, for your information. It is case-sensitive.
2 Likes
Bl_nkDev
(Bl_nkDev)
April 1, 2024, 4:39pm
#3
I changed it and now it says:
ServerScriptService.Player data:17: attempt to concatenate string with nil
Operatik
(Operatik)
April 1, 2024, 4:42pm
#4
Concatenation isn’t three dots like local key = “Player_”…userID
, it should be two dots to operate it. I can’t see the complete code anyway. What has changed?
post another post about this error and mark the above awnser as the solution, because this isnt related to the original error of you replacing Id with ID.
1 Like
Bl_nkDev
(Bl_nkDev)
April 1, 2024, 4:43pm
#6
sorry still new to all this, thank you for telling me.
1 Like
system
(system)
Closed
April 15, 2024, 4:45pm
#8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.