So I added a folder and values to a player and the name of the value is ‘human’.
But when I ran a script to see if it would detect the values nothing would print in the output
I haven’t been scripting in a long time and forgot most things. I am using a local script to find the local player and the values in it. Any help would be appreciated.
local Players = game:GetService("Players")
local Race = Players.LocalPlayer.PlayerValues.Race.Value
if Race == "Human" then
print ("Yes")
end
local Players = game:GetService("Players")
local Race = Players.LocalPlayer.PlayerValues.Race.Value
game.Players.PlayerAdded:Connect(function()
if Race == "Human" then
print ("Yes")
end
end)
Put this in a local script in StarterPlayerScripts. Often if something isn’t working on the client it’s because of replication. Waiting for things to be replicated fixes this.
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local PlayerValues = Player:WaitForChild(“PlayerValues”)
local Race = PlayerValues:WaitForChild(“Race”)
if Race.Value == "Human" then
print ("Yes")
else -- this is just to check the code is running and everything
print(Race.Value)
end