(This is a normal script, not a LocalScript)
Okay so, I'm trying to make a script so that you can click a gas can and it changes your value, if your value is changed, you can fuel something. I put this script in StarterCharacterScripts so that it creates a value when the player joins. Code:
local Player = game.Players.LocalPlayer
local Value = Instance.new("BoolValue")
Value.Parent = Player
Value.Name = "HasGas"
Value.Value = false
But, the problem isn't with the value. I'm trying to make the value change when you click a button, here's my code:
local Player = game.Players.LocalPlayer
local value = Player:WaitForChild("HasGas")
script.Parent.ClickDetector.MouseClick:Connect(function()
value.Value = true
end)
I get an error with this; here's the error: "attempt to index nil with WaitForChild"
Did I type or do something wrong? Thanks, and if you can help, that would be greatly appreciated.

2 comments
Is this second script a Script or a LocalScript?
Script, its in a part