So I am curious on making a deployable tool but instead of clicking, the player has to drop it like any tool with ‘CanBeDropped’ set to true.
But,
I want to make it so the tool cant be picked up and it anchors itself
So, How do I do this?
So I am curious on making a deployable tool but instead of clicking, the player has to drop it like any tool with ‘CanBeDropped’ set to true.
But,
I want to make it so the tool cant be picked up and it anchors itself
So, How do I do this?
This is my idea, although a bit unorthodox.
Add an event listener to check when the tool’s parent is changed (using AncestryChanged). On that event, check whether the tool’s parent is the Workspace. If it is, this means it was dropped. At this point, you should take the parts out of the tool and put them into an anchored model.
local tool = script.Parent
tool.AncestryChanged:Connect(function()
if tool.Parent = game.Workspace then
local model = Instance.new("Model")
for int, part in pairs(tool:GetChildren()) do
if part:IsA("BasePart") then
local clone = part:Clone()
clone.Anchored = true ; clone.Parent = model
end
end
model.Parent = game.Workspace
tool:Destroy()
end
end)
Hmm, I see how this works, Ill try it out and stuff
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.