MasonX890
(MasonX890)
December 24, 2022, 2:35am
#1
I have a Text button but I cant click it using MouseButton1 Click?
My script:
PlayerGui.MainUI.PhoneMain.OverlayContent.CloseButton.MouseButton1Click:Connect(function()
PlayerGui.MainUI.PhoneMain:TweenPosition(
UDim2.new(0.006, 0,0.988, 0),
"Out",
"Quad",
.2,
true
)
end)
nds_w
(NasaJam)
December 24, 2022, 2:38am
#2
go down
PlayerGui.MainUI.PhoneMain.OverlayContent.CloseButton.MouseButton1Down:Connect(function()
PlayerGui.MainUI.PhoneMain:TweenPosition(
UDim2.new(0.006, 0,0.988, 0),
"Out",
"Quad",
.2,
true
)
end)
MasonX890
(MasonX890)
December 24, 2022, 2:41am
#3
Still does not work for some reason
Is the TextButton.Active property set to true?
nds_w
(NasaJam)
December 24, 2022, 2:45am
#5
could have something blocking that button
2 Likes
MasonX890
(MasonX890)
December 24, 2022, 2:48am
#6
Ive set it ZIndex to 100 and it still doesn’t work
Lostude
(Lostude)
December 24, 2022, 2:55am
#7
I’m pretty sure this can’t be a server script, change it to a local script.
MasonX890
(MasonX890)
December 24, 2022, 3:06am
#8
it is a localscript its in startercharacter
Have the script be within the MainUI thing instead of starter character
MasonX890
(MasonX890)
December 24, 2022, 3:18am
#10
The weird thing is I have something were I click a ImageButton and it works just fine in the same localscript
Regardless, UI related scripts should be in the UI itself, not the character.
If you put a print statement within the function, does it output to console?
2jammers
(2jammers)
December 24, 2022, 3:22am
#12
All client scripts should reside in StarterPlayerScripts. When using RunContext you can also use ReplicatedStorage and more.
It doesn’t have to just be in the UI, you can also put them into StarterPlayerScripts and have it run there and just call ...LocalPlayer.PlayerGui:WaitForChild("GuiName")
to retrieve it then do stuff with it.
msix29
(msix29)
December 24, 2022, 10:39pm
#14
Something is blocking the button, a text an image or an invisible item, changing Z-Index
won’t fix this so your best choice is to move it out of the way or remove the item from it’s children.