StringValue not going into player

Hello! I have been having this issue, where this string value called “Equipped” is not going into the player.
Proof:

error1

error2


It would be nice if someone could help.
Thank you!

Can you try doing Instance.new("StringValue",player) and see if anything changes? Would also be good to see your full script if possible.

1 Like

Okay! That did not work, but here is the full script(I know this is from AlvinBlox’s tutorial. I am trying to learn how to script. I have rewatched his video multiple times and it was no good.):

Thanks for helping!

Thanks, but I don’t see where you are creating the ‘Equipped’ stringvalue. Is it under a PlayerAdded event?

1 Like

First can you send us the actual code, no images.
Then we can understand what is the code.

2 Likes

Okay. Code:

game.Players.PlayerAdded:Connect(function(player)
local playerToolsFolder = Instance.new(“Folder”)
playerToolsFolder.Parent = game.ServerStorage.PlayerTools
playerToolsFolder.Name = player.Name

local inShop = Instance.new("IntValue")
inShop.Name = "InShop"
inShop.Value = false
inShop.Parent = player

local player = game.Players.LocalPlayer
local leaderstats = player:WaitForChild("leaderstats")

local coins = player:WaitForChild("Coins")

local equipped = Instance.new("StringValue",player)
equipped.Name = "Equipped"
equipped.Parent = player

end)


The string value “Equipped” is supposed to be here(under player):
Error6

I added more detail to the issue in the my reply to LOG1CEXE’s reply.

Try removing local player = game.Players.LocalPlayer.

Okay. I do not know exactly where though?

local player = game.Players.LocalPlayer

I’m guessing this is a server script, you already defined player with “game.Players.PlayerAdded:Connect(function(player)”
you can’t get the LocalPlayer from a server script

1 Like

A few lines below the code for creating inShop.

1 Like

Put that code into a script instead of a local script.

1 Like

This is slightly irrelevant but, you could also use the new Attributes if you are trying to put a value in the player. You can use :SetAttribute and :GetAttribute.

1 Like