Remade stamper tool

Hello developers,
I decided I’d like to share my stamper tool with you guys that I remade to be filtering enabled compatible with my build to survive zombies remake.
It was a pain to fix so I really hope this helps people.
Note: Some models won’t work that have scripts in them due to the fact Roblox made them and I have no way of fixing them to be filtering enabled.
https://www.roblox.com/library/6375057601/Stamp-Tool-Remade
Code in a ServerScriptService script you will need:

game.ReplicatedStorage.RequestBrick.OnServerEvent:Connect(function(player, assetId)
local asset = game.ReplicatedStorage.Assets:FindFirstChild(assetId)
if asset == nil then
	asset = game:GetService("InsertService"):LoadAsset(assetId)
	asset.Name = assetId
	asset.Parent = game.ReplicatedStorage.Assets
	for _,v in pairs(asset:GetDescendants()) do
	if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("BasePart") or v:IsA("WedgePart") or v:IsA("CornerWedgePart") or v:IsA("UnionOperation") or v:IsA("PartOperation") or v:IsA("TrussPart") then v.Anchored = true
	end
	end
end
end)
function game.ReplicatedStorage.filterSet.OnServerInvoke(player,setId)

return game:GetService("InsertService"):GetCollection(setId)

end
function game.ReplicatedStorage.GetUserCategories.OnServerInvoke(player,userIdForStamperParts)

return game:GetService("InsertService"):GetUserCategories(userIdForStamperParts)

end
function game.ReplicatedStorage.LoadAsset.OnServerInvoke(player,assetId)
local asset = game.ReplicatedStorage.Assets:FindFirstChild(assetId)
if asset == nil then
	asset = game:GetService("InsertService"):LoadAsset(assetId)
	asset.Name = assetId
	asset.Parent = game.ReplicatedStorage.Assets
	for _,v in pairs(asset:GetDescendants()) do
	if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("BasePart") or v:IsA("WedgePart") or v:IsA("CornerWedgePart") or v:IsA("UnionOperation") or v:IsA("PartOperation") or v:IsA("TrussPart") then v.Anchored = true
	end
	end
end
return asset
end
AnchoredParts = {}
function Build(Name,ObjectID,Position,ObjectName,mouseHitInWorld)
local insertCFrame
local Place = game.Workspace.ActiveParts:FindFirstChild(Name.Name .. "'s parts")
local M = game:GetService("InsertService"):LoadAsset(ObjectID)

if M[ObjectName].ClassName == "Model" then
	M.Parent = Place
	local MParts = M[ObjectName]:GetChildren()
	for i = 1 ,#MParts do
		if MParts[i]:IsA("BasePart") then
			if MParts[i].Anchored == true then
				table.insert(AnchoredParts,i,MParts[i])
			end
			MParts[i].Anchored = true
		end
	end
	
	local M = M[ObjectName]
	M:MakeJoints()
	M:MoveTo(mouseHitInWorld)
	M.Name = ObjectName
	
	game.JointsService:CreateJoinAfterMoveJoints()
	
	for i = 1 ,#MParts do
		if MParts[i]:IsA("BasePart") then
			MParts[i].Anchored = true
			MParts[i].BrickColor = BrickColor.White()
		end
	end
	
	for i = 1,#AnchoredParts do
		AnchoredParts[i].Anchored = true
	end
	
else
	local object = M[ObjectName]
	object.Parent = Place
	object.CFrame = Position
	object.CFrame:pointToObjectSpace(mouseHitInWorld)
	object.Anchored = true
end
end
game.ReplicatedStorage.BuildObject.OnServerEvent:Connect(Build)
game.ReplicatedStorage.RenameRoot.OnServerEvent:Connect(function(player,root)
root.Name = "InsertedObject" .. root.Name
end)

Also, make sure to include the remote functions and remote events in the script in replicated storage
If you have any problems please let me know and I’ll be happy to help.

21 Likes

It’s very cool nice to see an old thing being brand new :wink:! however, maybe try adding more sounds so the player is more apparent on what they just did.

1 Like

I did everything you said and i keep getting errors about remote events and remote functions that dont exist

2 Likes

Create the remote events and functions that are in the script in replicatedstorage

Quoting this from the model description:

I cannot fix them as they were made by Roblox.

You can use InsertService to insert any model made by Roblox. You can also replace the IDs for the bricks with scripts in them, and attempt to fix them yourself.

For example, if I wanted to insert this, I could use

game:GetService("InsertService"):LoadAsset(56450668)

to insert it, and then I could fix the script. After I fix the script, I can upload it to Roblox as a Model and replace the ID that originally came with the stamper with my ID.

1 Like

I might actually do that when I get a chance. It will just take a while as there are so many of these models.

1 Like

Would really help if you could atleast make a slight tutorial on how to set this up

What are you exactly having trouble with?

Many things you haven’t exactly told us about like the Remote Events / Functions or even the folders that are needed to get this working. Would probably help best if you could make an un-copylocked “experience” with the build tool that has all the main server scripts and remote events/ folders.

2 Likes

Well a good example would be welcome to Roblox building or those build to survive games

1 Like

I feel like this is a bit complicated for people who don’t fully understand studio. If you were to show us what we need to insert, and where, people would be a little less confused.

2 Likes

You can also try my module it is less code just do this:

--For the module script
local module = {}

function module:Insert(id)
    local InsertService = game:GetService("InsertService")

    if id then
        InsertService:LoadAsset(tonumber(id)) -- I did tonumber so people can use a string
    end
end

return module

--Script

local module = require(script.ModuleScript)

module:Insert(--id here)

Hey, I’m having an issue with the stamper. There are no errors in the Output anymore, but when I click on an item to stamp it just says “Loading”, and after a few seconds goes back to the build menu. In other words, I’m unable to actually stamp anything as it just loads and then stops. I have put everything in that I think I need to but I’ve included a photo so you can see my exact setup. Please help? (Ignore the handgun in the photo btw)

Photo

1 Like

Hey guys bad news so I won’t be able to fix our Build to Survive Zombies Remake, or this remade stamper tool as Roblox deprecated GetUserCategories which is an important function needed for the stamp tool and there’s no replacement for it. :frowning:
If anyone has any ideas on what we could do feel free to let me know!

1 Like

model was delted, can you make a new one?

Sorry for late reply, but see above message as publishing a new one would be pointless :frowning: