So basically just like it says in the title, I am locally enabling a surface gui for a certain player. The only huge problem is that the surface gui button on mobile doesn’t seem to register any input.
Here’s an example on PC ;
Here’s an example on Mobile ;
I tried every possible way to register the mobile’s input, either it’s Activated, MouseButton1Down or even TouchTap doesn’t seem to work at all. I get no error either or any print that is inside those event.
Here’s what the script looks like when clicking on the button.
local Players = game:GetService('Players')
local event = game.ReplicatedStorage:FindFirstChild('Event'):FindFirstChild('ExitStationEvent')
local event_2 = game.ReplicatedStorage:FindFirstChild('Event'):FindFirstChild('FireToAllClientDisablePrompt')
local player_ownership
local btn = script.Parent
local model = btn.Parent.Parent.Parent
btn.Activated:Connect(function()
print("activated")
end)
btn.MouseButton1Down:Connect(function(x,y)
warn('Closing gui')
player_ownership = model:FindFirstChild('player_ownership').Value
if player_ownership then
if workspace:FindFirstChild(player_ownership) and workspace:FindFirstChild(player_ownership):FindFirstChild('Humanoid') then
event:FireClient(game.Players[player_ownership])
event_2:FireAllClients(game.Players[player_ownership], script.Parent.Parent.Parent.Parent:FindFirstChild('Interaction'):FindFirstChildWhichIsA('ProximityPrompt'), true)
btn.Parent.Parent.Parent:FindFirstChild('player_ownership').Value = " "
btn.Parent.Enabled = false
end
end
end)