I’m trying to make a function start when a player presses a button and stop when that player lets go of it.
I can’t find a way to get it so that the function inside of the function gets triggered when a player lets go of my custom buttons
Here’s my code
function OverCharged()
if Eqipped == true then
OverChargedHold:Play()
OverChargedOn:FireServer()
UIS.InputEnded:Connect(function(input, gameProcessedEvent) ========= im trying to make this function run when the player lets go of the custom button
if input.UserInputType == Enum.UserInputType.MouseButton1 then
OverChargedOff:FireServer()
OverChargedHold:Stop()
end
end)
end
end
local mobilebuttonL1 = contextActionService:BindAction(“OverCharged”,OverCharged,true,“MouseButton1”,“MouseButton1Up”)
contextActionService:SetPosition(“OverCharged”,UDim2.new(0.72,-25,0.20,-25))
contextActionService:SetImage(“OverCharged”,“http://www.roblox.com/asset/?id=68437731”)
local mobilebuttonF = contextActionService:BindAction(“Lantern”,Lantern,true,“F”)
contextActionService:SetPosition(“Lantern”,UDim2.new(1,-25,0.20,-25))
contextActionService:SetImage(“Lantern”,“http://www.roblox.com/asset/?id=68437731”)