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.