Hihi! I need assistance with a part and the void

I’ve been trying to make a challenge in my game that detects when “ChallengePart” is destroyed (by the void), the timer on the top of the screen will stop, but my if game.Workspace.ChallengePart.Position.Y <= -200 or -400, etc then game.StarterGui.PartChallenge.KILLTIMER.LocalScript.Enabled = false doesn’t work. Please help me create a more effective way, perhaps?

1 Like

You can just check if the part still exists or not using :FindFirstChild(“ChallengePart”)

for example

if not workspace:FindFirstChild("ChallengePart") then
   -- pusyo bruv
end
1 Like

Ah, thank you! :smiley:

Is there a way to make it loop until it finds out that the part doesnt exist?

--of course
repeat task.wait() until not workspace:FindFirstChild("ChallengePart")
1 Like

So like this?

repeat task.wait() until not workspace:FindFirstChild("ChallengePart")
if not workspace:FindFirstChild("ChallengePart") then
	game.StarterGui.PartChallenge.KILLTIMER.LocalScript.Enabled = false
end

u can remove the if statement but yeah

Alright, gonna test this now. Be right back

Didn’t exactly work.

repeat task.wait() until not workspace:FindFirstChild("ChallengePart")
	game.StarterGui.PartChallenge.KILLTIMER.LocalScript.Enabled = false
end

without the if statement, right?

what is that end bruv, remove the end function on your script

Oops, it automatically placed itself when doing the if statement.

Without the if statement and without end, still doesn’t stop the timer.

Is it cause it’s not a localscript?

LocalScript did not work either.

I assume this script is undoable. It seems like anything I try to do isn’t working.

I’m not sure how to reach PlayerGui, if anyone can help would be cool.

Here’s how to navigate to it. Obviously, this should be in a LocalScript.

game.Players.LocalPlayer.PlayerGui

Aha, yeah I did that but it didn’t work cus i was in a global one. Tysm!

why dont you put that local script inside your gui object, and get the variables easily wth no trouble??

The problem is this is too advanced for me. I have no idea how, I wanna keep it simple.