I’m making a script that when a boolvalue is false, the part didn’t appear, and when the value is true, the part appear.
Thats the script
while true do
if script.Parent.Active.Value == true then
script.Parent.Transparency = 1
script.Parent.CanCollide = false
else
script.Parent.Transparency = 0
script.Parent.CanCollide = true
end
wait()
end
You’ve got your transparency the other way round. Should be :
while true do
if script.Parent.Active.Value == true then
script.Parent.Transparency = 0
script.Parent.CanCollide = true
else
script.Parent.Transparency = 1
script.Parent.CanCollide = false
end
wait()
end
Nothing updates the value of Active, although you probably have anotehr script for that, also, it’s better to use .Changed for this case
local part = script.Parent
part.Active.Changed:Connect(function(newval)
part.Transparency = newval and 0 or 1
part.CanCollide = newval and true or false
end)
If something doesn’t work how you want it to, just switch the values around
If you change it from the Client, the server cannot detect it so it wont do anything, you can try this as a test
local part = script.Parent
part.Active.Changed:Connect(function(newval)
part.Transparency = newval and 0 or 1
part.CanCollide = newval and true or false
end)
wait(10)
part.Active.Value = true
If it doesn’t work, then switch 0 and 1 around and also true and false
local part = script.Parent
local active = script.Parent.Active
if active.Value == true then
part.Transparency = 0
part.CanCollide = true else
part.Transparency = 1
part.CanCollide = false
end