Exploits can clone tools to their inventories?

Hello Roblox Developers,

I recently created an inventory of swords, which makes me worry that Exploits can clone a tool saved within the player. How this system works:

  1. The player purchases an item, and the client sends it to a Remote (Server), which checks to see if the player has the money, and if he doesn’t have the item. If the player has the money but doesn’t have the item, the item will be added to his inventory, saving it.

  2. After saving, the item will be saved in a folder called “OwnedSwords”, inside the player in Tool format. And the saved item will be cloned with scripts inside the player folder.

My concern is whether a player who uses cheats can clone this item into their inventory to use.
I’m sorry if my English is bad, English is not my main language.
I appreciate any help.

1 Like

This could happen BUT, im assuming that the script(s) in the sword is or are either: Client and Server or only Server. The case with both is: if the exploiter tries to clone it, it goes to their inventory but they cannot use it. I’ve tested this myself with a tool that has a Client script and a Server script, and it only did the things that the client does, it affected nothing of the server world.
Conclusion:
Yes, but the tool won’t work.

2 Likes

Hmm, interesting. I was thinking of a different method, the inventory Script will clone the purchased Swords to the player’s folder, and erase the Sword’s Scripts inside, and leave only the Module, which the game uses to identify the equipped item.

Thanks for the reply. I’ll come back later and give you some updates.

What game? It shows your games are inactive. I would like to test for you

Oh, my games are inactive because I was away from Roblox Studio for a few months. Also, I was making a total change to the game, so for now it’s just testing.

Could you send me a friend request later? I’ll open it for you to test.

1 Like

I don’t add but if you make the game public can test it for you

It is open for testing, there will be a green part next to the shop that will provide you with the item in your inventory.

1 Like
-- This script should be placed on the ServerScriptService or the tool store logic
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

-- Define the tool you are selling (you could get this from the tool store)
local toolTemplate = game.ServerStorage.ToolTemplate -- This is your tool template

-- Event for buying a tool (you could trigger this from a RemoteEvent)
local buyToolEvent = ReplicatedStorage:WaitForChild("BuyToolEvent")

-- Function to check if the player already owns the tool
local function playerOwnsTool(player, toolName)
    for _, tool in ipairs(player.Backpack:GetChildren()) do
        if tool:IsA("Tool") and tool.Name == toolName then
            return true
        end
    end
    return false
end

-- Handling the buy tool event
buyToolEvent.OnServerEvent:Connect(function(player, toolName)
    -- Check if the player already owns the tool
    if playerOwnsTool(player, toolName) then
        -- Inform the player that they already own the tool
        print(player.Name .. " you already have the tool!")
        return
    end

    -- If the player doesn't own the tool, give it to them
    local newTool = toolTemplate:Clone()
    newTool.Name = toolName
    newTool.Parent = player.Backpack
end)

This will prevent them from being able to purchase the same tool

1 Like

Make sure it also checks that whoever sent the remote is a real player in the game. Also, make the Sword of Unlimited Power, unseen in the game; it is a trap, and on the spots yields a lifetime ban.

2 Likes

One question, how can I make an anti-spam tool? For example, the player buys the item and keeps equipping and unequipping it quickly.

EDIT 1: I managed to do this.