Is there a way if a player is playing on a mobile device so you can code it to do something like like if player is on mobile then do that?
✓ ANSWER ACCEPTED
Is there a way to detect what platforms players are on ?
3 answers
✓ Accepted answer
There is no way to be 100% sure what platform a player is playing on. However, you can get a pretty good idea with some of UserInputService's functions
local UserInputService = game:GetService("UserInputService")
UserInputService:KeyBoardEnabled() --If true it's most likely PC
UserInputService:TouchEnabled() --If true it's most likely a mobile device
--If neither are true it's most likely console
--If both are true it's most likely a laptop with a touchscreen
Game:GetService'UserInputService':GetPlatform
Yes there is. here you go. Put this in a script and insert it in the part.
script.Parent.Touched:Connect(function(what)
print("This platform has been touched.")
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
