**Hello Developers
I was thinking about a standard kill script Below
So for this question I want to focus on the key aspect of “Humanoid” Basically this script says when a Humanoid touches it that it will kill the humanoid. However is it possible if im holding a part that i drop i could replace “Hummanoid” with “tool1” example. If this isn’t possible is there another way to do it? I have looked at YouTube Videos and Roblox API and all i can find is a kill block. Am I thinking logically or is there another way to do this that is correct?
Thank You For those who respond c:
I still don’t understand… I guess you want to check a tool’s previous owner?
What exactly are you trying to do?
Are you trying to delete the tool that gets dropped, or are you trying to kill the humanoid of the player who drops the tool?
1 Like
I suppose you want to detect when a tool (which is dropped / outside of player’s inventory) is dropped into a certain part, and destroy it. In order for this to work, your tool would need a part inside of it, which can touch the “kill” part. I’m not very certain of how you want this to work when the tool is dropped, so I’ve created two different scripts.
- Script #1 will destroy the dropped tool when a certain part is touched by it.
- Script #2 will destroy the tool when it is dropped (doesn’t require touch).
Script #1
local VoidBlock = script.Parent -- Place this script inside of your part
local function onTouch(part)
local tool = part:FindFirstAncestorWhichIsA("Tool")
if tool then
if not tool.Parent:FindFirstChildOfClass("Humanoid") then
tool:Destroy()
end
end
end
VoidBlock.Touched:Connect(onTouch)
Script #2
local Tool = script.Parent -- Place this script inside of the tool
Tool:GetPropertyChangedSignal("Parent"):Connect(function()
if Tool.Parent == game.Workspace then
Tool:Destroy()
end
end)
2 Likes