Script works on PC but not on mobile?

Greetings developers, so recently I have been making a military game with my developer team and I seem to have found an issue. Because Roblox platform mostly has mobile players we are also trying to make the game fully mobile compatible but for some reason, some of our scripts work on PC but not on mobile? I do not know the cause of this, and it’s not just one script, it’s multiple like the admin script for CMDR, overhead tag, etc. Support and quick replies are apricated. Here is one of the scripts with that issue.

ServerScript:

local status = require(game.ReplicatedStorage.Modules.StatusData)
local kos = status.KOS
local aos = status.AOS
local vip = status.VIP
local GS = game:GetService("GroupService")
local Radius = status.VIPRADIUS

game.Players.PlayerAdded:Connect(function(Playerdas)
	Playerdas.CharacterAdded:Connect(function(Character)
		
		
		local hum = Character:WaitForChild('Humanoid')
		hum.Died:Connect(function()
			local VIPrad = Character:FindFirstChild("VIPAREA")
			local tag = Character:WaitForChild("Head"):FindFirstChild("Nametag")
			if VIPrad then
				VIPrad:Destroy()
			end
			if tag then
				tag:Destroy()
			end
		end)
	end)
end)



game.ReplicatedStorage.Remotes.OverheadEvent.OnServerEvent:Connect(function(Player)
	if Player.Character:WaitForChild("Head"):FindFirstChild("Nametag") == nil then
		local tag = script.Nametag:Clone()
		tag.Parent = Player.Character:WaitForChild("Head")
		wait()
		local selectedteam = Player:WaitForChild("PlayerGui"):WaitForChild("main").Frame.teams.selected.Value
		local team = game.Teams:FindFirstChild(selectedteam)
		local platersteam = team.Requirements.GROUPID.Value
		local das = Player:GetRoleInGroup(platersteam)
		if not team:GetAttribute("REDACTED") then
			tag.Frame.Username.Text = Player.Name
			tag.Frame.Rank.Text = das
			tag.Frame.Rank.TextColor = Player.TeamColor
			if Player:GetRankInGroup(14318910) > 253 then
				tag.Frame.Username.Text = "[🔨] "..Player.Name
			end	
		else
			tag.Frame.Rank.Text = ""
			tag.Frame.Username.Text = team:GetAttribute("OverwriteNametag") or "REDACTED"
			tag.Frame.Username.TextColor = BrickColor.new("Really black")
		end
		if Player.Team == game.Teams["Off Duty"] then
			tag.Frame.Rank.Text = "Immigrant"
		end
		local Groups = GS:GetGroupsAsync(Player.UserId)
		for _,group in pairs(Groups) do
			if kos[tostring(group.Id)] and group.Rank >= kos[tostring(group.Id)] then
				tag.Frame.Status.Visible = true
				tag.Frame.Status.Text = "KOS"
				tag.Frame.Status.TextColor3 = Color3.fromRGB(250, 0, 0)
			elseif aos[tostring(group.Id)] and group.Rank >= aos[tostring(group.Id)] then
				tag.Frame.Status.Visible = true
				tag.Frame.Status.Text = "AOS"
				tag.Frame.Status.TextColor3 = Color3.fromRGB(94, 0, 0)
			elseif vip[tostring(group.Id)] and group.Rank >= vip[tostring(group.Id)] then
				tag.Frame.Status.Visible = true
				tag.Frame.Status.Text = "VIP"
				tag.Frame.Status.TextColor3 = Color3.fromRGB(227, 227, 0)

				local VIPrad = Player.Character:FindFirstChild("VIPAREA") or Instance.new("Part")
				VIPrad.Massless = true
				VIPrad.Parent = Player.Character
				VIPrad.Name = "VIPAREA"
				VIPrad.Shape = Enum.PartType.Cylinder
				VIPrad.Anchored = false
				VIPrad.CanCollide = false
				VIPrad.CanQuery = false
				VIPrad.BrickColor = BrickColor.new("Maroon")
				VIPrad.Size = Vector3.new(0.001, Radius[tostring(group.Rank)], Radius[tostring(group.Rank)])
				VIPrad.Transparency = 0.5
				local VIPweld = VIPrad:FindFirstChild("Weld") or Instance.new("Weld")
				VIPweld.Name = "VIPRadiusWeld"
				VIPweld.Parent = VIPrad
				VIPweld.Part0 = Player.Character.HumanoidRootPart
				VIPweld.Part1 = VIPrad
				VIPweld.C1 = CFrame.new(-2.9000001, 0, 0, -4.37113883e-08, -1, 0, 1, -4.37113883e-08, 0, 0, 0, 1)
			end
		end
	end
end)

ModuleScript:

local module = {}

module.VIP = {
	["32347449"] = 17,
}

module.AOS = {
	["3333298"] = 1,
}

module.KOS = {
	["4217910"] = 1,
}

module.VIPRADIUS = {
	["255"] = 30,
	["254"] = 25,
	["54"] = 9,
	["55"] = 9,
	["21"] = 20,
	["20"] = 18,
	["19"] = 17,
	["18"] = 15,
	["17"] = 10,
}

return module

Could have some latency issues or you didin’t publish some scripts or the game didn’t update.

Try adding coroutines or some task.wait(). just to alleviate the latency. if that’s the case.

Have you attempted to find which line the code halts at when ran on mobile?
This can be easily achieved by sticking prints everywhere, and then testing on mobile.

Every time before I even release the script I use print statements but because the script doesn’t work at all it doesn’t even print.

There is no latency, entire game is fully well preforming, I tested it on multiple devices and it seems to work fine as long as its not mobile.

Try doing this on module:

‘123’: 45,`

instead of [“123”] = 45,

didn’t work at all now but, interestingly enough, no errors

Can we see how the client interacts with the server?

I forgot about this post, the player would click play button to fire the remote but regardless, the issue was that the character limbs were locked, it’s solved now.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.