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

How come my script wont delete the screen gui when it says to do so?

How come when I test my game its never deletes the screen GUI even tho it says to do so what when wrong?

---|Script|---

local a = Color3.fromRGB(255,255,255)
local b = Color3.fromRGB(12,53,0)
local Camera = workspace.CurrentCamera
local plr = script.Parent.Parent.Parent.Parent.Parent.Parent.Name

script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Parent.Carthaginians.TextColor3 == b then 
		script.Parent.TextColor3 = b
		if script.Parent.TextColor3 == b then
			wait(1) 
			Camera.CameraType = Enum.CameraType.Custom
		end
			game.Players.LocalPlayer.TeamColor = BrickColor.new("Earth green")
			game.Workspace.Character.Humanoid.Health = "0"
			script.Parent.Parent.Parent:Destroy()
	    end
    end)

---|Locations|---

The local script is located in a button called Select and the button's parent is a frame then the frame's parent is the screen GUI.


1 comment

0

try script.Parent.Parent.Parent."name of what you wanna destroy":Destroy() . you must gain the appropriate reference to the object you want to destroy other wise it wont work

1 answer

✓ Accepted answer

Humanoid.Health is not a string value. You tried to set it to "0". You should be setting it to just 0.

5 comments

0

That does not answer my but thanks for the help.

0

Do you have Discord? I can help you faster there.

0

I do.

0

And in the processes can you help me with something else?

0

My discord is vincentthecat1#1253.

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