Here’s the deal. I’m doing fixes for Mobile Support in my badge hunting game, and I have gears that are given to the player if they own a certain badge. When I load up the game on PC with the badges owned the gears are moved into my inventory. When loading up the game on Mobile however, no gears are moved into my inventory. Furthermore I have gears in my game you can click to pick up into your inventory and those don’t work on Mobile either. Here is one of the scripts for Badge Gears. Does anyone know why this script doesn’t work on Mobile?
local badgeService = game:GetService(“BadgeService”)
local gear = {
game.Lighting.TixGun;
}
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function()
if badgeService:UserHasBadgeAsync(plr.UserId, 2124853219) then
for i,v in pairs(gear) do
print(v.Name)
v:Clone().Parent = plr:WaitForChild(‘Backpack’)
end
end
end)
end)
The script that gives tools when they respawn should work fine, the ones where you can click to pickup however are probably the problem. If you give me the code for those, I can try to fix it for you.
if player then
if player.Backpack:FindFirstChild("TombKey") then
return
else
local Copy = game.Lighting.TombKey:Clone()
Copy.Parent = player.Backpack
end
end
end)
Odd. Does this happen in studio on mobile testing mode, or only on mobile ingame? Also, can you verify that the inventory gui is not being disabled for mobile players? (Do ctrl+shift+f and search for SetCore. Also check if the tools are being parented to the player’s backpack).
Quite odd. I couldn’t find anything wrong with your code. If you were able to verify that the tools weren’t able to be parented to the player’s backpack, you could try parenting the tools once to the player’s StarterGear, a built in feature that allows a character to spawn with tools.
Example code:
local badgeService = game:GetService("BadgeService")
local plrs = game:GetService("Players")
local gear = {
game.Lighting.TixGun;
}
plrs.PlayerAdded:Connect(function(plr)
if badgeService:UserHasBadgeAsync(plr.UserId,2124853219) == false then return end
local starterGear = plr:WaitForChild("StarterGear")
for i,v in pairs(gear) do
print(v.Name)
v:Clone().Parent = starterGear
end
end)
If the tools were successfully parented to the player’s backpack, and the inventory is enabled, I don’t really know how to solve this problem.
Kind of a random guess but I think Roblox Mobile is limited to 3 items in the hotbar? (Not too sure though, but that is how it is in my game for some reason and I don’t think I changed any settings) Do you think that maybe they are in your backpack and not in the hotbar?
I got my mobile friend to join the game and her gears worked, so it must be something with my phone. I tried reinstalling roblox and it still doesnt work for me. Im gonna find some other mobile users to help test this out