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 4 years ago
Edited 4 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:

01local timer = game.Workspace.Timer.SurfaceGui.TextLabel
02local part = game.Workspace.saracie
03while true do
04    if timer.Text == "25"
05    then
06        part.Transparency = 1
07    else
08        if timer.Text == "0" then
09            part.Transparency = 0
10wait(3)
11part.Transparency = 1
12 
13        end
14        end
15 
16    end

2 answers

Log in to vote
0
Answered by 4 years ago
01local PartInvis = false
02 
03while true do
04    if Partinvis == true then
05        part.Transparency = 0
06        PartInvis = false
07 
08                else
09        Part.Transparency = 1
10        PartInvis = true
11    end
12 wait(25)
13end

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 4 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. :)

01Part=script.parent
02Part.Transparency=0
03Part.CanCollide=true
04 
05while true do
06    Part.Transparency=1
07    Part.CanCollide=false
08    wait(25)
09    Part=script.parent
10    Part.Transparency=0
11    Part.CanCollide=true
0
That would only work once. generalYURASKO 144 — 4y
0
It will also error lmao. Ziffixture 6913 — 4y

Answer this question