Hi there!
For some reason, and I do not know why, when I hover my mouse/press on a TextButton, it just doesn’t work or do anything.
I have a folder, with the same models, and also a script, which basically creates a little screen, which is the SurfaceGui. But for some reason, the TextButtons just don’t work when the Adornee is set.
This is what the GUI looks like:
And this is what currently happens:
https://gyazo.com/3cb004f99c86097f34f33d2eb077e48e
This is the current module script that I have which creates all the GUIs:
local Cabanas = workspace:WaitForChild("Cabanas")
local TweenService = game:GetService("TweenService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CurtainOpen = false
local controls = {
Owned = nil
}
function controls:CreateScreens()
for _, Cabana in pairs(Cabanas:GetChildren()) do
local ScreenPart: Part = Cabana:FindFirstChild("Screen", true)
print(ScreenPart)
local NewScreen = script.CabanControl:Clone()
NewScreen.Parent = game.Players.LocalPlayer.PlayerGui:WaitForChild("CabanaControls")
NewScreen.Adornee = ScreenPart
local CurtainControl = NewScreen:FindFirstChild("Curtains", true)
local LightControl = NewScreen:FindFirstChild("Lights", true)
local WhitelistControl = NewScreen:FindFirstChild("Whitelist", true)
print(CurtainControl)
CurtainControl.Button.MouseEnter:Connect(function()
print("test")
end)
CurtainControl:WaitForChild("Button").MouseButton1Click:Connect(function()
if self.Owned == Cabana then
ReplicatedStorage.Sprinklify.CabanaControl:FireServer("curtains", not CurtainOpen, Cabana)
CurtainOpen = not CurtainOpen
if CurtainOpen then -- i have 0 clue on why i've doen it like this
CurtainControl.Button.TextDisplay.Text = 'Curtains: <font color="rgb(255,0,0)">Closed</font>'
else
CurtainControl.Button.TextDisplay.Text = 'Curtains: <font color="rgb(57,255,2)">Open</font>'
end
end
end)
end
end
return controls
If anyone has any ideas on why this is happening, please let me know, thanks!