Hey y’all, I need some help in my scripting because I’m not very good at scripting and I want to solve this problem, I’ve looked everywhere for solutions but because my problem is so specific, it’s harder to find out how to solve it.
It is also hard to find a good title for this because of the problem being specific.
I want to make a game where you destroy stuff for lag.
The issue is that I can’t find out how to make it so that when the object gets destroyed, it leaves your inventory. And if I can’t do it, then when you deselect the object you are holding, the broken parts disappear, which I don’t want to happen because I am making a game intended to lag.
I have looked for many solutions, but I couldn’t get a good solution. I tried copying the destroyed object into the workspace so that when you break it and don’t hold the gear anymore, it will still remain on the floor as pieces, but I am not a good scripter so I didn’t know how to do it, and to delete the gear after the copy. Another attempt was to drop the gear (-which is the object), but when I wrote the script, it still was in my inventory. It was like semi-dropped, because I didn’t hold it in my hand anymore, but it was in my inventory and when I deselected the gear, the pieces still disappeared.
This is the script I made to break the object in pieces.
I used the F3X building tools plugin to weld the object easier. That’s why the weld is called BTWeld.
tool = script.Parent.Parent
handle = tool:WaitForChild(“Handle”)
tool.Activated:Connect(function()
print (“microwave dead”)
for count = 1, 82 do
script.Parent.Parent.Handle.BTWeld:Destroy()
end
end)
This script is made by watching tutorials and by looking at https://developer.roblox.com/ to learn new commands.
I get errors trying to load video footage of the problem, sorry.