So originally this script with serverside script makes datastore to know which device bought the gamepass most, but after i have added “tablet” as device, it broke my mobile, console script and it doesnt create datastore for tablet?
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("DeviceEvent")
local device
if UserInputService.TouchEnabled then
if UserInputService:IsMouseButtonDown(Enum.UserInputType.MouseButton1) then
device = "Mobile"
else
device = "Tablet"
end
elseif UserInputService.KeyboardEnabled then
device = "PC"
else
device = "Console"
end
remoteEvent:FireServer(device)
But with this localscript, everything works fine for these 3 devices:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("DeviceEvent")
local device
if UserInputService.TouchEnabled then
device = "Mobile"
elseif UserInputService.KeyboardEnabled then
device = "PC"
else
device = "Console"
end
remoteEvent:FireServer(device)