Hi! I made a simple button for equipping and unequipping of my gun. On my PC it works completely fine, but when I run it on a mobile it doesn’t work.
This is how it works on PC:
robloxapp-20200730-1433504.wmv (1.1 MB)
and this just broken mobile version: robloxapp-20200730-1431153.wmv (1.2 MB) .
Here is the code in a local script:
local equiped = false
local cool = false
equip.TouchTap:Connect(function()
if equiped == false then
print(equiped)
equiped = true
print(equiped)
cool = true
pick:Play()
pick.Stopped:Connect(function()
cool = false
idle:Play()
end)
else
pick:Stop()
idle:Stop()
shoot:Stop()
print(equiped)
equiped = false
print(equiped)
end
end)
It always prints: true false, which means it immediately skips to the else statement.
For the PC version, the code is the same, with only difference I am using MouseButton1Click event