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

Attempt index nil boolean with 'getpropertychangedsignal'?

Thats that explaning there on the title. I try to do db.value:Getpropert.. etc But same thing. How to detect the data boolean in the script?

local db = true

db.GetPropertyChangedSignal():Connect(function()
	print(db)
end)

print(db)

while true do
	wait(2)
	db = false
	wait(2)
	db = true
end

3 comments

0

Do not code aimlessly. It appears you have no knowledge on how Instance:GetPropertyChangedSignal is meant to be used; pay a visit to the API reference.

0

As for detecting when a variable changes, that's not possible. If you need something done, you know exactly where the mutation occurs.

0

poor ziffixture

1 answer

✓ Accepted answer

You need to understand a bit tables and methods, basically OOP programming. GetPropertyChangedSignal is a method that is usable by some instances in the game. That means you cannot use it on data type. Thats like if you wanted to use :GetChildren() on a table. Simplified, you cannot use most of in-build functions on data types, only instances that are in game. Boolean value is an instance, but bool data type you used is just data type, just variable of certain type! Maybe learn lua itself first, more about how it works, and after move to roblox coding :D. I hope this helped you, have a nice day.

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