Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I have a script that makes GUI's visible but its not destroying the script. Can someone help me?

local TextButton = script.Parent
wait(15.5)
TextButton.Visible = true
if TextButton.Visible then
script:Destroy()
print("script destroyed")
end

1 comment

0

is it a local script or a server script

2 answers

destroying scripts in roblox is not consistant, it typically results in a warning that says Something tried to parent script to nil .. I don't think there's a workaround to this, the best thing u can do is set variables in the script to release the memory that they occupy..

2 comments

0

I never got an error like that..hmm odd.

0

like i said, its very incosistant..

first of all idk what your looking in but to see if the script has destroyed or not go to Players--> 'Your Player Name' --> PlayerGui --> and go on to your gui from there

local TextButton = script.Parent
	wait(15.5)
	TextButton.Visible = true
	if TextButton.Visible then
			print("script destroyed")
		script:Destroy()
		end

your script is working but i edited it so it prints "script destroyed" because if its destroyed the script doesnt run anymore

1 comment

0

the script doesnt destroy

This discussion is preserved as it was. New answers, comments, and votes are closed.