GuiButton Modal isnt working

my game uses mouse unlocker for several reasons
it used to work perfectly fine until now

idk if this is a engine bug or it related to the code itself

Code Example

local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local screenGui = Instance.new("ScreenGui",playerGui)
local textButton = Instance.new("TextButton")
textButton.BackgroundTransparency = 0
textButton.Size = UDim2.new(0,0,0,0)
textButton.Parent = screenGui

local Unlocked = false

UIS.InputBegan:Connect(function(input,chat)
	if not chat then
		if input.KeyCode == Enum.KeyCode.L then
			if Unlocked == false then
				textButton.Modal = true
				Unlocked = true
				print("unlocked")
			elseif Unlocked == true then
				textButton.Modal = false
				Unlocked = false
				print("locked")
			end
		end
	end
end)```

Is there an error output when you run the code?

absolutely not, those audio error are not related to the code

textButton.Size = UDim2.new(0,0,0,0)

increase scale to X 1 and Y 1

you might wanna check what’s position in it

3 Likes

There is an ongoing issue with GUI on studio at the moment, it might be that I’m not entirely sure. I don’t see a problem with the code and as you mentioned it used to work fine. Here is a link to another forum post which a roblox staff member comments on the issue. "Multiple StyleLinks" warning without using StyleLinks - #19 by SirZellek1994

3 Likes

this temporarily solved my problem, thx!!!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.