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