-- module script
function Imessages:ToggleMessage()
-- Determine which message to show based on enabled flags
local messageToShow = message1Enabled and Message1 or (message2Enabled and Message2)
if not messageToShow then return end -- Exit if neither message is enabled
if isMessageVisible then
messageToShow.Visible = false
messageToShow.ZIndex = defaultZIndex -- Reset ZIndex when hidden
BlurEffect.Enabled = false -- Disable blur when message is hidden
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
print("Hiding message") -- Debugging
else
messageToShow.Visible = true
messageToShow.ZIndex = activeZIndex -- Set higher ZIndex when shown
ViewMessage.Visible = false -- Hide the "View Message" button after viewing the message
BlurEffect.Enabled = true -- Enable blur when message is visible
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
print("Showing message") -- Debugging
end
isMessageVisible = not isMessageVisible -- Toggle the visibility state
end
-- local script
local Imessages = require(game:GetService("ReplicatedStorage").ModuleScript)
-- Show "Jaylen Brown" message
Imessages:NameAndSet("Jaylen Brown", 2) -- Set sender and number of messages
Imessages:EnableMessage1() -- Enable Message1 for toggling
Imessages:ShowMessage(3) -- Show notification for Message1 with a 3-second display time
-- Wait before switching to the next message
task.wait(5)
-- Show "Dad" message
Imessages:NameAndSet("Dad", 3) -- Set sender and number of messages
Imessages:EnableMessage2() -- Enable Message2 for toggling
Imessages:ShowMessage(3) -- Show notification for Message2 with a 3-second display time
basically the message doesnt become visible
if i press q there is a message system an it doesnt become visible (only for message 2) but for message 1 i press q its visible please note only can be visible when function called and Q pressed