What is happening with ROBLOX and values?

https://gyazo.com/06bdb914f7fa33d6ecf868c424fb62f9.png

Try this and tell me if it works:

chr:WaitForChild("BuyingSomething").Value = true;
print(chr:WaitForChild("BuyingSomething").Value);

Huh…

(dont mind theerror below, woops)

Woa… Show me where does the chr variable come from.

The chr variable is the actual problem.

It comes from this CharacterAdded function…

Show me the script please, as it dosent say so.

Alrighty…

plrs.PlayerAdded:Connect(function(plr)
	
	local stats = Instance.new("Folder")
	stats.Name = "leaderstats"
	stats.Parent = plr
	
	local points = Instance.new("IntValue")
	points.Name = "Points"
	points.Value = 750
	points.Parent = stats
	
	plr.CharacterAdded:Connect(function(chr)
		repeat wait() until chr.Parent == workspace
		if chr.Parent == workspace then
			local h = chr:FindFirstChild("Humanoid")
			
			h.Changed:Connect(function()
				for i,v in pairs(workspace.Rays.PurchasableBarricades:GetChildren()) do
					local dist = (chr.HumanoidRootPart.Position - v.Door.Position).magnitude

					chr:WaitForChild("BuyingSomething").Value = true;
					print(chr:WaitForChild("BuyingSomething").Value);

this is the main section of the script

Oh wait, that script looks like is from another script. Try to click the error and see its source.

Oh yeah, that was by mistake I noticed already, that error was from another script, because I tried to move “buyingWhat” outside of the BuyingSomething value :smile:

And tell me its actual error line.

Cool. Nice :slight_smile: Good luck, just for future stuff, make sure to give a valid amount of information before asking.

In fairness, I think he gave the right amount of information for this. The end result just happened to be very different than we originally thought.

I’ll just wait it out I guess, see if anything somehow changes xd

1 Like

Sure, just tell me when anything happens.

Alright, thanks i’ll update anyone if something happens

Oh, I figured it was nothing to do with ROBLOX studio but perhaps the other stuff on the same script, which supposedly set it to false immediately when it was set to true… somehow, well I solved it ty for the support!

1 Like

This thread is so mind-bogglingly bloated for no good reason. Just switch to another object and click back, then check the value. If you’re setting it to true and it appears as false, there’s one of two reasons:

  • Another script is setting the object’s value to false.
  • You’re setting the value from the client and viewing the object from the server.

Can’t be an edge case related to object non-existence because there’s no error, or so I’m assuming.

Simple. Done.

4 Likes

That’s true, the first point. Another script was setting it to false