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

how can i make a part that becomes visible every 25 seconds?

Asked by 3 years ago
Edited 3 years ago

hello. i am trying to make a script that makes a transparent part visible when a 25 seconds timer hits 0 but it doesn't work. this is my script:

local timer = game.Workspace.Timer.SurfaceGui.TextLabel
local part = game.Workspace.saracie
while true do
    if timer.Text == "25" 
    then
        part.Transparency = 1
    else
        if timer.Text == "0" then
            part.Transparency = 0
wait(3)
part.Transparency = 1

        end
        end

    end


2 answers

Log in to vote
0
Answered by 3 years ago
local PartInvis = false 

while true do 
    if Partinvis == true then
        part.Transparency = 0
        PartInvis = false

                else
        Part.Transparency = 1
        PartInvis = true
    end
 wait(25)
end

All that's happening is this while loop will continuously run, but will pause for 25 seconds after running the code before running it again. The PartInvis is only used to determine whether at the time the code is running the part is transparent.

Ad
Log in to vote
0
Answered by 3 years ago

I didn't really understamd what you were saying, but anyway, here's a script that makes the part disappear every 25 seconds. Let me know if this helps. :)

Part=script.parent
Part.Transparency=0
Part.CanCollide=true

while true do
    Part.Transparency=1
    Part.CanCollide=false
    wait(25)
    Part=script.parent
    Part.Transparency=0
    Part.CanCollide=true
0
That would only work once. generalYURASKO 144 — 3y
0
It will also error lmao. Ziffixture 6913 — 3y

Answer this question