Visible script not working on part

while true do
	script.Parent.Visible = false
	wait(5)
	script.Parent.Visible = true

My script is in a part. But I don’t understands how it’s not working

Add another wait(5) after you set the Visible property to true again, because if you only wait 5 seconds after changing it to false, it’ll set the property back to true, then back to false as quick as possible without even seeing it

Parts don’t have a Visible property in the first place unless if you’re changing some sort of “UIObject” (Frame, TextLabel, ImageButton)

You probably want the Transparency property if you want to change the visibility of actual Parts

--For UI's:
while true do
    script.Parent.Visible = false
    wait(5)
    script.Parent.Visible = true
    wait(5)
end
-- For BaseParts:
while true do
    script.Parent.Transparency = 1
    wait(5)
    script.Parent.Transparency = 0
    wait(5)
end

Parts dont have the property Visible on a part.

You can use Transparency to hide it.

while true do
	script.Parent.Transparency = 0
	wait(5)
	script.Parent.Transparency = 1
end
while task.wait(5) do
    script.Parent.Transparency = 1
    task.wait(5)
    script.Parent.Transparency = 0
end

I want to make it that the part never existed then be real

Can you reword this question? Im not sure what you mean

Hey there,

You can just set the parts parent to nil, then re-parent it to the workspace.

OR

you can edit the part’s variables (such as CanCollide) to false, and transparency to 1, then set those both back when ready.

Nevermind , I fixed it. I just forgot can collide. Thanks for ur answers!

There are a lot of other choices you can make with this, and if you just want the Part to be non-existant, define it as a “Variable” then set it’s Parent to nil, and into the workspace every 5 seconds or so

This saves you the trouble of even having to keep changing its properties in the first place, as you can just simply bring it to Brazil (Which is nil), then set it to the workspace afterwards & it’s properties will still be the same

Although I am sure that you’ll have to place the Script somewhere else in order for that to properly work (Not in the part) because I believe the Script will also go “bye bye” as it’s still inside the part

local Part = workspace.Part --Part Instance Here

while true do
    Part.Parent = nil
    wait(5)
    Part.Parent = workspace
    wait(5)
end

This is just my personal opinion

I already told it’s fixed but thanks