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

Custom character GUI button not triggering?

I'm making a custom character GUI in which the player is able to customize and color their cat character, yet, I cannot get the first box to open when I click the button to customize that option. Please, tell me what I am doing wrong! D: The script I am using is this-

Player = game.players.LocalPlayer
C = Player.Character
x = 2
script.Parent.MouseButton1Click:connect(function()
	script.Parent.Parent.Parent.UpTorsoCol.Visible= not script.Parent.Parent.Parent.UpTorsoCol.Visible
end)

script.Parent.MouseEnter:connect(function()
	for 1 = 1,10 do 
		x = x + 0.2
		script.Parent.BorderSizePixel = x
		wait (0.025) 
	end
end)
script.Parent.MouseEnter:connect(function()
	for 1 = 1,10 do 
		x = x - 0.2
		script.Parent.BorderSizePixel = x
		wait (0.025) 
	end
end)

2 answers

✓ Accepted answer

On line 5, I think there's just something off about it

 script.Parent.Parent.Parent.UpTorsoCol.Visible= not script.Parent.Parent.Parent.UpTorsoCol.Visible

If you want to switch it to Visible or Invisible, it should be like this shouldn't it?

 script.Parent.Parent.Parent.UpTorsoCol.Visible= false -- To make it invisible
 script.Parent.Parent.Parent.UpTorsoCol.Visible= true -- To make it visible

4 comments

0

Also I do not understand on why you just did the same thing twice for absolutely no reason at all. (Line 8 and 15) Both of them do the exact same thing.

0

Line 5 is like a toggle. When you click it once, the thing turns invisible. When you click it again, the thing turns visible. It’s a really nice and easy way to toggle things while saving some lines of code.

0

Thanks for the help, but it still refuses to work. ;-;

0

Oh, srry that it still doesn't work. I don't think I really deserve my answer getting accepted and the reputation I get, but it's ok >:)

I found a better alternative, making various colors and then hooking them to various parts. Thank you for answering, if you did, though ;D

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