Skip to content

Instantly share code, notes, and snippets.

@Fraktality
Created December 1, 2017 20:31
Show Gist options
  • Save Fraktality/31ff7daa2bf5c2d6a3e6295cd8121255 to your computer and use it in GitHub Desktop.
Save Fraktality/31ff7daa2bf5c2d6a3e6295cd8121255 to your computer and use it in GitHub Desktop.
local function hostos()
local msvc
local posix
for _ = 1, 8 do
local k = math.random()
msvc = 0 == k*0x7FFF%1
posix = 0 == k*0x7FFFFFFF%1
if msvc ~= posix then
break
end
end
if msvc == posix then
return Enum.Platform.None
end
local console = game:GetService'GuiService':IsTenFootInterface()
local touch = game:GetService'UserInputService'.TouchEnabled
if console then
if msvc then
return Enum.Platform.XBoxOne
else
return Enum.Platform.PS4
end
end
if msvc then
return Enum.Platform.Windows
end
if touch then
math.randomseed(0)
local k = math.random()*0x7FFFFFFF
if k == 520932930 then
return Enum.Platform.IOS
elseif k == 366850414 then
return Enum.Platform.Android
end
else
return Enum.Platform.OSX
end
return Enum.Platform.None
end
@lunaticAnn
Copy link

°˖✧◝(⁰▿⁰)◜✧˖°

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment