I am developing a game, and I'm trying to add a tag to your player that displays how much money you have, so the game can read that, and if you have a certain amount of rebirths you can go through a door.
Here's what I got.
local Workspace = game:GetService("Workspace") local Players = game:GetService("Players") local Name = Players.LocalPlayer.Name local Humanoid = script.Parent:WaitForChild("Humanoid") local Tag = Instance.new("NumberValue") Tag.Name = "Tag" Tag.Parent = Workspace.Name print(" name is" ..game.Workspace[Name].Tag.Value ..".")
but, it says localplayer is a nil value, can anyone help with that?
It is doing the error because you can not use LocalPlayer in a normal script. It would work in a LocalScript. Sorry!