It’s just a normal proximity prompt that has the style set to custom. I want it to work for all custom proximity prompts in the game, so the script that handles an individual prompt shouldn’t matter.
Since there’s no MouseButton1Down and MouseButton1Up equivalents events for touch users, i suggest using InputBegan, InputChanged and InputEnded events to handle mobile user input.
Thanks for the help but i’ve managed to find the answer:
All you have to do is make the prompt’s textbutton trigger InputHoldBegin() when the mouse is down and vice versa:
if inputtype == Enum.ProximityPromptInputType.Touch or prompt.ClickablePrompt then
local button = gui.TextButton
local buttonDown = false
button.InputBegan:Connect(function(input)
if (input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1) and
input.UserInputState ~= Enum.UserInputState.Change then
prompt:InputHoldBegin()
buttonDown = true
end
end)
button.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then
if buttonDown then
buttonDown = false
prompt:InputHoldEnd()
end
end
end)
gui.Active = true
end