diff --git a/anti-cheat-code-and-text.md b/anti-cheat-code-and-text.md new file mode 100644 index 000000000..8fbf7ee8b --- /dev/null +++ b/anti-cheat-code-and-text.md @@ -0,0 +1,49 @@ +# Anti-Cheat: Unauthorized Script Detection for Roblox Games + +## Introduction + +In this document, we'll cover how to implement a system that detects unauthorized scripts in Roblox games. If a player tries to insert scripts that are not in the `ServerScriptService`, the game will automatically ban and disconnect them. + +## Key Practices + +- **Server-Side Script Validation**: Always ensure that scripts inserted by players are monitored and validated. +- **Game Integrity**: Prevent players from injecting or modifying scripts in unauthorized locations. + +## Example Code: Unauthorized Script Detection + +The following Lua code checks if a player has implemented any scripts outside of `ServerScriptService` and bans them if detected. + +```lua +-- Function to check if a player has unauthorized scripts +local function checkForUnauthorizedScripts(player) + -- Get the player's scripts folder (if they have one) + local playerScripts = player:FindFirstChild("PlayerScripts") + if not playerScripts then return end + + -- Loop through each script in PlayerScripts + for _, script in pairs(playerScripts:GetChildren()) do + -- Check if the script is located outside of ServerScriptService (i.e. unauthorized) + if script:IsA("Script") or script:IsA("LocalScript") then + local scriptParent = script.Parent + if scriptParent.Name ~= "ServerScriptService" then + -- If unauthorized script is found, ban the player and disconnect + game:GetService("BanService"):BanPlayer(player, "Implemented unauthorized scripts.") + player:Kick("You have been permanently banned for attempting to modify the game with unauthorized scripts.") + break + end + end + end +end + +-- Monitor for new players joining the game +game.Players.PlayerAdded:Connect(function(player) + -- Call the function to check the player's scripts + checkForUnauthorizedScripts(player) +end) + +-- Optional: Check periodically for any new scripts added while the game is running +game:GetService("RunService").Heartbeat:Connect(function() + for _, player in pairs(game.Players:GetPlayers()) do + checkForUnauthorizedScripts(player) + end +end) diff --git a/restricted-features-code.md b/restricted-features-code.md new file mode 100644 index 000000000..21b4c54e5 --- /dev/null +++ b/restricted-features-code.md @@ -0,0 +1,33 @@ +local function isAgeVerified(player) + -- Placeholder: Simulate an age verification check + -- Example: Return true if the player has an "AccountAgeVerified" property (mocked) + return player.AccountAgeVerified or false +end + +-- Function to restrict access to a feature based on age verification +local function restrictFeature(player, featureName) + if isAgeVerified(player) then + -- If the player is age-verified, allow access to the feature + print(player.Name .. " is allowed to use the " .. featureName .. " feature.") + -- You can enable the feature (e.g., show UI, enable developer tools) + else + -- If the player is not age-verified, deny access to the feature + print(player.Name .. " is restricted from using the " .. featureName .. " feature.") + -- Deny access and provide feedback to the player + player:Kick("You need to verify your age to access the " .. featureName .. " feature.") + end +end + +-- Example: When a player joins, restrict access to certain features +game.Players.PlayerAdded:Connect(function(player) + local restrictedFeatures = { + "Developer Teams", -- Feature requires age verification + "Advertisements", -- Feature requires age verification + "Sponsors" -- Feature requires age verification + } + + -- Loop through each feature and apply the restriction + for _, feature in ipairs(restrictedFeatures) do + restrictFeature(player, feature) + end +end) diff --git a/restricted-features-text.md b/restricted-features-text.md new file mode 100644 index 000000000..85d467d6c --- /dev/null +++ b/restricted-features-text.md @@ -0,0 +1,25 @@ +# Restricted Features in Roblox Studio and Creator Hub + +Some features in Roblox Studio and Creator Hub require you to verify your age to access them. Age verification ensures a safe and compliant environment for developers. + +## Features Requiring Age Verification +To use the following features, you must verify your age on Roblox: +1. Developer Team +2. Advertisements +3. Sponsors + +## Why Age Verification is Required +Age verification is necessary to: +- Ensure compliance with Roblox's policies. +- Maintain a secure platform for all users. +- Enable responsible use of advanced tools and features. + +## How to Verify Your Age +To verify your age: +1. Log in to your Roblox account. +2. Go to **Settings** > **Account Info**. +3. Follow the instructions to upload an official ID and complete the verification process. + +If your account is not age-verified, you will not be able to use these features. + +---