Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Attempt index nil boolean with 'getpropertychangedsignal'?

Asked by
TechModel 118
2 years ago

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

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. Ziffixture 6913 — 2y
0
As for detecting when a variable changes, that's not possible. If you need something done, you know exactly where the mutation occurs. Ziffixture 6913 — 2y
0
poor ziffixture greatneil80 2647 — 2y

1 answer

Log in to vote
1
Answered by 2 years ago

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.

Ad

Answer this question