#Modular script activates function it isnt supposed to

1 messages · Page 1 of 1 (latest)

crisp plaza
#

i have a script where if the power text is "0" then its supposed to change the value of a numbervalue in replicated storage to 1
i also have a modular script, which is supposed to check if the value is set to 0, if not, its supposed to do nothing
issue is whenever the value IS set to 0, the rest of the function still happens, how do i fix this?

hidden arch
#

Since you're using GetPropertyChangedSignal("Text")

#

Maybe you need to make some kind of debounce

crisp plaza
#

debounce?

hidden arch
#

Yeah like:

local debounce = false

if debounce == false then -- this would be inside the local function you made
end

#

And then after this check, you set debounce = true

keen spade
#

where do you call the module from

#

client or server

crisp plaza
hidden arch
#

if debounce == false
debounce = true
end

keen spade
#

are you changing the value on client or server

crisp plaza
#

local scripts were client sided right?

steady remnantBOT
#

studio** You are now Level 7! **studio

hidden arch
crisp plaza
#

crap

#

could that be the issue?

keen spade
#

yes

hidden arch
#

Scripts are server sided

keen spade
#

you are changing on client

#

but the server cant see that

#

you will need to use a remote