I’m currently working on a system for a game, where if you change a BoolValue from false to true then a part changes transparency and vice versa.
My issue is is that when I change the BoolValue from false to true nothing really happens, the script doesn’t even print the input I put.
I’ve tried using a loop where it constantly checks if the value has been updated or not, but my studio ended up crashing and the game was very laggy.
Any help would be appreciated
The Script
local Value = workspace.TestValue
local Base = workspace.Door1
Value.Changed:Connect(function(value)
if value == true then
Base.Transparency = 0.8
Base.CanCollide = false
print("It is true")
else
Base.Transparency = 0
Base.CanCollide = false
print("It is false")
end
end)
local Value = workspace.TestValue
local Base = workspace.Door1
Value.Changed:Connect(function()
if Value.Value == true then
Base.Transparency = 0.8
Base.CanCollide = false
print("It is true")
else
Base.Transparency = 0
Base.CanCollide = false
print("It is false")
end
end)
local Value = workspace.TestValue
local Base = workspace.Door1
Value.Value.Changed:Connect(function()
if Value.Value == true then
Base.Transparency = 0.8
Base.CanCollide = false
print("It is true")
else
Base.Transparency = 0
Base.CanCollide = false
print("It is false")
end
end)
Where are you changing the Value first? In the client or in the server? If you change it in the client, then in the server it wouldn’t be the same. You should change the value via server. That could be the reason why it’s not changing and not printing anything.
You don’t have to move the script anywhere. The only thing you should do is change the value in the server. If you are changing the value using a LocalScript, then it won’t be replicated in the server or in simpler words, it won’t change in the server. It would only change locally or to the player only, and the server, your script specifically, would detect no changes in the value.