An Item Giver Gives Item On PC But Not On Touch Screen Devices

Hi guys, I am not sure if this is a Roblox bug or something but this is causing a lot of problem. My code according to 2 developers is correct, yet it’s not functioning correctly. This is a code for an item giver, meaning that as soon as one touches the giver it gives a specific tool. As simple as that and it works excellently on a PC, the problem occurs on a mobile and most probably all the other touch screen devices. If you touch the giver when you are using a mobile or any other touch screen device, it will ignore you completely and give you nothing. Why is that? How can I eliminate this problem ?Thanks for your support and valuable time. Code is provided below:

local debounce = false

script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) then
if game.Players:GetPlayerFromCharacter(hit.Parent) then
if not debounce then
debounce = true
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
local gun = game.ServerStorage.Remington870:Clone() – Change the “LaserGun” to whatever you want lol gay OH AND YES dont forget to put it in ServerStorage ok now you can remove me from team create lol bye
gun.Parent = Player.Backpack
wait(3)
debounce = false
end
end
end
end)print(“Hello world!”)

On a last note, some developers thought the, “Hello World” may be causing the problem. I removed that and checked to find out that it had nothing to do with the problem whatsoever, the script does print, “Hello World” in the end if you are wondering.

1 Like

How did you try it ? Using studio or in the Device itself?

Both. I tried using an iPhone 6 in the Studio (The emulator) and used my Android phone after publishing it to see if it works.

I tried in the Studio emulator(On Iphone 6 as well as one Xbox) with your code changing some variable references and it works for me .

Hmm what do you think may be the problem?

I don’t see any problem that causes it to not work on other devices , but another problem is you are doing the debounce for the entire server so if u step on the pad , other players couldn’t step on it for 3 seconds.

Indeed, sorry for a late reply I had some personal stuff to do and yeah I will deal with it accordingly later.