Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Custom character GUI button not triggering?

Asked by 6 years ago
Edited 6 years ago

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

Log in to vote
0
Answered by
Nep_Ryker 131
6 years ago

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
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. Nep_Ryker 131 — 6y
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. User#20279 0 — 6y
0
Thanks for the help, but it still refuses to work. ;-; Kozybee 4 — 6y
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 >:) Nep_Ryker 131 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

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

Answer this question