#It works on Roblox Studio's mobile device emulator but doesn't work on an actual mobile device

1 messages · Page 1 of 1 (latest)

forest jasper
#
local UserInputService = game:GetService("UserInputService")

local branch = script.Parent
local open = branch:WaitForChild("TextButton")
local MainFrame = branch:WaitForChild("Frame")
local changeLogLabel = MainFrame:FindFirstChild("ChangeLog")

open.MouseButton1Click:Connect(function()
    local platform = UserInputService:GetPlatform()
    if platform == Enum.Platform.IOS or platform == Enum.Platform.Android then
        open.Text = "Not for Mobile yet"
        
        if changeLogLabel and changeLogLabel:IsA("TextLabel") then
            local originalText = changeLogLabel.Text
            changeLogLabel.Text = "Not available for mobile devices :("
            
            task.delay(1, function()
                changeLogLabel.Text = originalText
            end)
        end

        MainFrame.Visible = false

        task.delay(1, function()
            open.Text = "Change Log"
        end)

        return
    end

    if not MainFrame.Visible then
        MainFrame.Visible = true
        open.Text = "Close"
    else
        MainFrame.Visible = false
        open.Text = "Change Log"
    end
end)

I have a change log in my game but the GUI is currently a bit broken for mobile devices, while I'm trying to fix it I wanted to make it so when a mobile player clicks on the button it doesnt open the frame and instead says "not available for mobile devices yet" on the button for one second, and yeah it works on the roblox studio's device emulator but it doesn't work on an actual mobile device as I checked (This script was made by AI cuz I have 0 scripting understanding)

formal swan
#

mobile doesn't have a mouse open.MouseButton1Click

#

this is why you should always use Activated instead.

#

also maybe platform is wrong UserInputService:GetPlatform() i'd suggest looking that up in the docs

forest jasper
#

i tried every other version of this script and this is the only one that at least works in roblox studio, others i have dont even work on roblox studio nor in roblox

sinful caveBOT
#

studio** You are now Level 2! **studio

forest jasper
#

now when i put in this script after testing some more it fully broke down