Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

player value not resopding to a script why???

game.Players.PlayerAdded:connect(function(p) local stats = Instance.new("IntValue", p) stats.Name = "leaderstats" local money = Instance.new("StringValue", stats) money.Name = "test" money.Value = "gunA"

if game.Players.LocalPlayer.leaderstats.test == "gunA" then game.Workspace.Baseplate.Color = BrickColor.White() end end)

the brick color does not change and no output of the studio??? why is this and how to fix this?

1 comment

1

Use a code block.

1 answer

✓ Accepted answer

You're trying to compare the test stringValue to "gunA". You should be checking the value instead, so this line:

if game.Players.LocalPlayer.leaderstats.test == "gunA" then

should be

if game.Players.LocalPlayer.leaderstats.test.Value == "gunA" then 

1 comment

0

^

This discussion is preserved as it was. New answers, comments, and votes are closed.