Skip to content

Instantly share code, notes, and snippets.

@mrparkerlol
Last active May 24, 2024 12:56
Show Gist options
  • Save mrparkerlol/429893057031e476fc0933becb1c041b to your computer and use it in GitHub Desktop.
Save mrparkerlol/429893057031e476fc0933becb1c041b to your computer and use it in GitHub Desktop.
Patch to download Roblox on Apple Silicon rather than the Intel build.
#!/bin/bash
show_fps_prompt=0
unlock_fps () {
if [[ ! -d /Applications/Roblox.app/Contents/MacOS/ClientSettings ]]; then
mkdir /Applications/Roblox.app/Contents/MacOS/ClientSettings
fi
# https://stackoverflow.com/a/32890622
if [[ $# -eq 2 && $1 == "--fps" ]]; then
echo "Setting target FPS to $2"
echo "{ \"DFIntTaskSchedulerTargetFps\": $2 }" > /Applications/Roblox.app/Contents/MacOS/ClientSettings/ClientAppSettings.json
else
echo "Setting target FPS to 144"
echo "{ \"DFIntTaskSchedulerTargetFps\": 144 }" > /Applications/Roblox.app/Contents/MacOS/ClientSettings/ClientAppSettings.json
fi
}
install () {
echo "Installing Roblox Player & Studio!"
versionStudio=$(curl --silent "${macStudioVersionEndpoint}" | ./jq -r ".clientVersionUpload")
versionStudioName="${versionStudio}-RobloxStudioApp.zip"
# Player Install
echo "Downloading fresh copy of Player for Apple Silicon"
# Downloads the RobloxPlayer to the current directory
curl -o ${versionName} "${baseURL}/${versionName}" --progress-bar
echo "Installing Roblox with the Apple Silicon build..."
if [[ -d /Applications/Roblox.app ]]; then # checks if it is installed, removes if it is
rm -rf /Applications/Roblox.app
fi
unzip -qq ${versionName}
mv RobloxPlayer.app /Applications/Roblox.app
echo $version > /Applications/Roblox.app/Contents/MacOS/version # used to make sure latest is installed by script for FPS unlock option
echo "Roblox Player for Apple Silicon is now installed!"
# Studio Install
echo "Downloading fresh copy of Studio for Apple Silicon"
curl -o ${versionStudioName} "${baseURL}/${versionStudioName}" --progress-bar
echo "Replacing Roblox Studio binary with ${versionStudioName}"
if [[ -d /Applications/RobloxStudio.app ]]; then
rm -rf /Applications/RobloxStudio.app
fi
unzip -qq ${versionStudioName} -d /Applications/
echo $versionStudio > /Applications/RobloxStudio.app/Contents/MacOS/version # used to make sure latest is installed by script for FPS unlock option
echo "Roblox Studio for Apple Silicon is now installed!"
if [[ show_fps_prompt == 1 ]]; then
clear
echo "To unlock fps, simply re-run the script but add the --unlockFPS argument,"
echo "in order to lock to a target fps, use --fps with a number (for example, 144)"
echo "Example to just unlock FPS (sets it to 144):"
echo "curl -fSSL https://mrparker.dev/scripts/roblox.sh | bash -s -- --unlockFPS"
echo "Or, to set a specific target FPS (can be set to any FPS):"
echo "curl -fSSL https://mrparker.dev/scripts/roblox.sh | bash -s -- --fps 250"
fi
}
if [[ ! $(uname -m) -eq "arm64" ]]; then
echo "Do not run this on Intel-based Macs - you will not be able to run Roblox! This is intended for Macs with M-series chips (Apple Silicon)!"
exit
fi
macPlayerVersionEndpoint="https://clientsettings.roblox.com/v2/client-version/MacPlayer"
macStudioVersionEndpoint="https://clientsettings.roblox.com/v2/client-version/MacStudio"
baseURL="https://setup.rbxcdn.com/mac/arm64"
mkdir robloxInstallScripttmp
cd robloxInstallScripttmp
curl --silent -L https://github.com/jqlang/jq/releases/download/jq-1.7rc1/jq-macos-arm64 > jq
chmod a+x jq
version=$(curl --silent "${macPlayerVersionEndpoint}" | ./jq -r ".clientVersionUpload")
versionName="${version}-RobloxPlayer.zip"
if [[ $1 == "--unlockFPS" || $1 == "--fps" ]]; then
run_install=0
if [[ -d /Applications/Roblox.app && -f /Applications/Roblox.app/Contents/MacOS/version ]]; then
if [[ $(cat /Applications/Roblox.app/Contents/MacOS/version) == $version ]]; then
unlock_fps
else
run_install=1
fi
else
run_install=1
fi
if [[ $run_install == 1 ]]; then
# Run the install first
install
# Then unlock FPS
unlock_fps
fi
else
show_fps_prompt=1
install
fi
cd ..
rm -rf robloxInstallScripttmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment