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

Changed event within scripts without an object?

Asked by
RoyMer 301 Moderation Voter
5 years ago

I was wondering whether there is a way to trigger the Changed event within a script having no object.

This is what I am trying to achieve:

local x = 100
x.Changed:Connect(function()
    print("Triggered")
end)

Any ideas?

0
No. There is not. Numbers are primitive and cannot be indexed like that. Just use a NumberValue. programmerHere 371 — 5y

2 answers

Log in to vote
1
Answered by
Gojinhan 353 Moderation Voter
5 years ago

Create a number value under the script and watch for changes there.

Ad
Log in to vote
0
Answered by
gloveshun 119
5 years ago
Edited 5 years ago

Explain... If you want to know a variable can trigger when its value is changed, No The variables can't trigger

Answer this question