– Sorry if this is the wrong place to ask something like this, I’m extremely new to forums like this.
-
What do you want to achieve? Keep it simple and clear!
I want my script to read the IntValue.Value correctly after it changes. I want to know why my script isn’t working as intended, and how to fix it. -
What is the issue? Include screenshots / videos if possible!
I have a folder named “Upgrades” copied into every player, in that folder is an IntValue named “inventorySize”. I have a script located in a part in the workspace, that, when activated by a proximity prompt, should print the value of this IntValue. This is the script I used.
proximityPrompt.Triggered:Connect(function(player)
local inventorySize = player:WaitForChild("Upgrades"):WaitForChild("inventorySize").Value
print(inventorySize)
end)
The issue is, say I set my IntValue to value 1 to start off with. I run the game and I trigger the proximity prompt, it prints value 1. When I change the IntValue to different number, like 2, while the game is still running, and then trigger the proximity prompt again, it still prints value 1. This doesn’t make any sense at all, my IntValue is 2, not 1.
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried using a NumberValue instead of an IntValue. I’ve tried changing the IntValue manually using the Explorer. The script still doesn’t print the new value.
Edit: I have a localScript in Starter.Gui that reads the new value of the IntValue just fine.