Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

For some reason it says "Position is not a member of tool" as the error. Can someone help?

local Zombie = game:GetService("Workspace"):WaitForChild("Zombie")
local Key = game:GetService("ServerStorage"):FindFirstChild("Key")

if Zombie:FindFirstChild("Humanoid") then
	local Humanoid = Zombie.Humanoid
	Humanoid.Died:connect(function()
		local keySpawn = Key:Clone()
		keySpawn.Parent = game.Workspace
		keySpawn.Position = Zombie.HumanoidRootPart.Position
		Zombie:Destroy()
	end)
end

1 comment

0

Key is a Tool, so I'm assuming you can just assign the Handle's Position to that HRP's Position?

1 answer

✓ Accepted answer

Tool does not have a property named Position. Instead of getting the tool.Position do tool.Handle.Position

local Zombie = game:GetService("Workspace"):WaitForChild("Zombie")
local Key = game:GetService("ServerStorage"):FindFirstChild("Key")

if Zombie:FindFirstChild("Humanoid") then
    local Humanoid = Zombie.Humanoid
    Humanoid.Died:connect(function()
        local keySpawn = Key:Clone()
        keySpawn.Parent = game.Workspace
        keySpawn.Handle.Position = Zombie.HumanoidRootPart.Position
        Zombie:Destroy()
    end)
end

This discussion is preserved as it was. New answers, comments, and votes are closed.