The script's intended purpose is to detect when its parent object is touched, then add 1 to an IntValue contained in StarterCharacterScripts. I get the aforementioned error on line 13. Shouldn't I be able to access the "Value" property like I can access "Color" and "Transparency" on things such as parts? And yes, I know there is a bit of spaghetti going on here.
stimPack = script.Parent
local function onPartTouch(otherPart)
local partParent = otherPart.Parent
local humanoid = partParent:FindFirstChildWhichIsA("Humanoid")
if humanoid then
local character = humanoid.Parent
local player = game.Players:GetPlayerFromCharacter(character)
local stims = player:FindFirstChild("Stims")
local stimvalue = stims.Value
print(player, "has picked up a Syringe!")
stimValue += 1
end
end
stimPack.Touched:Connect(onPartTouch)

3 comments
i dont think its the value that has the problem but the stims var
this is how i see it: your stims value is in the character but your stims var searches the Player and therefore the game couldnt find stims because stims is never there in the player because its in the character
if the game couldnt find something that exists it is automatically set to nil and the game gets "nil.Value"