Is AntiPiracy Script Ok?

If I put in an AntiPiracy script in my game, would I be banned?

I heard that a lot of open-source game when you search for them on the platform are stolen. so, I want to make sure my game does not get stolen.

I decided on make a script to lock out the players so they can’t play the stolen game and stops all scripts so if there are crosswords in the stolen version it hopefully gets blocked. The idea is to keep both the players and my game safe.

here’s my script for you to read and see the contents.

local VALID_OWNER = "Magic_Crash" 

local WARNING_TEXT = "This game has been stolen! Do NOT play this stolen version of the game, the stealer could of put something in like crosswords to get you BANNED from ROBLOX! If your the owner you should never steal peoples games like this, its not good."


local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
local RunService = game:GetService("RunService")

local function getOwnerName()
	if game.CreatorType == Enum.CreatorType.User then
		local success, name = pcall(function()
			return Players:GetNameFromUserIdAsync(game.CreatorId)
		end)
		if success and name then
			return name
		end
	elseif game.CreatorType == Enum.CreatorType.Group then
		return "GROUP"
	end
	return nil
end

local function createWarningGui(player)
	local playerGui = player:WaitForChild("PlayerGui", 5)
	if not playerGui then return end

	if playerGui:FindFirstChild("StolenWarningGui") then return end

	local gui = Instance.new("ScreenGui")
	gui.Name = "StolenWarningGui"
	gui.IgnoreGuiInset = true
	gui.DisplayOrder = 1000
	gui.Parent = playerGui

	local bg = Instance.new("Frame")
	bg.Size = UDim2.new(1, 0, 1, 0)
	bg.BackgroundColor3 = Color3.new(0, 0, 0)
	bg.BackgroundTransparency = 0.2
	bg.Parent = gui

	local header = Instance.new("TextLabel")
	header.Size = UDim2.new(1, 0, 0, 50)
	header.BackgroundColor3 = Color3.new(0.5, 0, 0)
	header.TextColor3 = Color3.new(1, 1, 1)
	header.Font = Enum.Font.SourceSansBold
	header.TextScaled = true
	header.Text = "This copy of the game appears stolen"
	header.Parent = gui

	local message = Instance.new("TextLabel")
	message.Size = UDim2.new(0.9, 0, 0.6, 0)
	message.Position = UDim2.new(0.5, 0, 0.5, 0)
	message.AnchorPoint = Vector2.new(0.5, 0.5)
	message.BackgroundTransparency = 1
	message.TextColor3 = Color3.new(1, 1, 1)
	message.Font = Enum.Font.SourceSansBold
	message.TextScaled = true
	message.TextWrapped = true
	message.Text = WARNING_TEXT
	message.Parent = gui
end

local function quarantineScripts()
	local thisScript = script
	local quarantineFolder = ServerStorage:FindFirstChild("QuarantineScripts")
	if not quarantineFolder then
		quarantineFolder = Instance.new("Folder")
		quarantineFolder.Name = "QuarantineScripts"
		quarantineFolder.Parent = ServerStorage
	end

	for _, inst in ipairs(game:GetDescendants()) do
		if inst:IsA("Script") and inst ~= thisScript and not inst:IsDescendantOf(quarantineFolder) then
			pcall(function()
				inst.Disabled = true
				inst.Parent = quarantineFolder
			end)
		end
	end
end

local function showWarning()
	for _, player in ipairs(Players:GetPlayers()) do
		createWarningGui(player)
	end
	Players.PlayerAdded:Connect(createWarningGui)
	quarantineScripts()
end

local ownerName = getOwnerName()
print("[Magic_Crash's AntiPiracy] Detected owner:", ownerName, "CreatorType:", tostring(game.CreatorType))
local inStudio = RunService:IsStudio()

if inStudio then
	print("[Magic_Crash's AntiPiracy] Running in Studio; skipping check.")
elseif ownerName == VALID_OWNER then
	print("[Magic_Crash's AntiPiracy] Valid owner detected (" .. ownerName .. "). No warning shown.")
else
	warn("[Magic_Crash's AntiPiracy] Invalid owner (" .. tostring(ownerName) .. "). Showing stolen game warning.")
	showWarning()
end
2 Likes

You’re allowed to do this, or even obfuscate your scripts, as long as it’s for your own game. However, this won’t really do anything, because, if the user has access to this code, they can simply modify it. When looking at stolen games, you’ll first have to consider how it was stolen.

Basic theft uses exploits, which will download everything that the client has access to. This will include everything in the Workspace that has loaded in for them, ReplicatedStorage, everything inside their Player, all LocalScripts, all modules that are accessible to the client, etc. However, nothing server-side only can be stolen this way, which includes server-side scripts, regardless of where they are located.

Full game theft only occurs from either giving an untrusted person Team Create access or using a malicious plugin or free model that introduces a backdoor into your game.

On the topic of obfuscation, I wouldn’t really bother with that either. It just slows down code execution and worsens the gameplay experience. You should instead focus on improving user experience and reducing cheating in your game, if your game is the type of game for cheating to matter (though, always include sanity checks for things like remotes and whatnot).

4 Likes

Thanks for the information. I spent an hour on this just because I was scared for my work being stolen.

4 Likes

Sorry for bumping. Main issue here is that if they have a copy of the game, they can just delete this script and then republish it.

1 Like

Like @BaconHair16773 has said

But even if your game gets stolen, you can file a DMCA request which is basically just trademark stuff. Then they will handle it accordingly

1 Like

executors are client sided, so if exploiter tries to (saveinstance) your game, they will get map and localscripts, but not server scripts.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.