Device Detect Script Not Working

my device detecting script won’t work. from pc when i join it works perfect but when i join from a phone its not working.

the BillBoardGui needs to clone to players head and display a small img with the device he uses.

local script(ReplicatedFirst):

player = game.Players.LocalPlayer

UserInputService = game:GetService("UserInputService")

Console = UserInputService.GamepadEnabled

Pc = UserInputService.KeyboardEnabled

Mobile = UserInputService.TouchEnabled

wait(20)

if Pc then

game.ReplicatedStorage.device:FireServer("Pc")

print("fired")

elseif Mobile then

game.ReplicatedStorage.device:FireServer("Mobile")

print("fired mobile")

elseif Console then

game.ReplicatedStorage.device:FireServer("Console")

print("fired console")

end

server script(ServerScriptService):

game.Players.PlayerAdded:Connect(function(player)
	
	local ServerStorage = game:GetService("ServerStorage")
	local GuiFolder = ServerStorage:FindFirstChild("DeviceGui")	
	
	game.ReplicatedStorage.device.OnServerEvent:Connect(function(plr,Device)
		player.CharacterAdded:Connect(function(character)
			
		if Device == "Pc" then
			GuiFolder:FindFirstChild("BillboardGuipc"):Clone().Parent = player.Character:FindFirstChild("Head")
		elseif Device == "Mobile" then
			GuiFolder:FindFirstChild("BillboardGuimo"):Clone().Parent = player.Character:FindFirstChild("Head")
		elseif Device == "Console" then
			GuiFolder:FindFirstChild("BillboardGuico"):Clone().Parent = player.Character:FindFirstChild("Head")
			end
		end)
	end)
	
end)
1 Like

Are you sure, the script doesn’t have:
Any script errors
Any mis-spelling in the script
And it works on the mobile/console/pc view on Studio?
If those are not the problem and they are all correct, i have no idea then.

i don’t have any errors in the studio. on pc its working but phone don’t.

I’m not sure. Might be a client issue. Maybe make the gui scale to all devices and turn graphics quality to 10?

i tried it and for some reason it still don’t work

The last question is, did you code it so Every Single Client can see it and not only certain people? Cuz that might be the issue.

I posted all my scripts in the “Device Detect” model

one server script with that code, and one client in the ReplicatedFirst.
the remote event is in the ReplicatedStorage