I’m trying to make it wear only the football comes out when you die, I have multiple gears in my inventory and I would like only the football to be drop out of my inventory when I die? I tried many scripts but none of them worked.
On a server script you can try:
local function clearItem(targetName, Directory, humanRPCFrame)
for _,v in pairs(Directory) do
if(v:IsA("Tool") and v.Name == targetName) then
v.Parent = workspace;
v.CFrame = CFrame.new(humanRPCFrame) * CFrame.Angles(0,0,0) + vector.new(0,4,0);
end
end
end
--//
game:GetService("Players").PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local Human = char:WaitForChild("Humanoid");
local HumanRP = char:WaitForChild("HumanoidRootPart");
Human.Died:Connect(function()
spawn(function()
clearItem("Football", char, HumanRP.CFrame);
end)
clearItem("Football", plr:WaitForChild("Backpack"), HumanRP.CFrame);
end)
end)
end)
I recommend you should also set game:GetService("Players").CharacterAutoLoads = false
then load the character after the script finishes running.
If there’s any errors, let me know since I typed this on here with no testing.
Alright I have tried it out, but the football would drop through the ground and disappear or it just somethings doesn’t work.
Sorry, There were errors in that code since I typed it here. I tested this one and it works fine for me:
local function clearItem(targetName, Directory, humanRPCFrame)
for _,v in pairs(Directory) do
if(v:IsA("Tool") and v.Name == targetName) then
v.Parent = workspace;
v:FindFirstChildWhichIsA("BasePart").CFrame = CFrame.new(humanRPCFrame.Position) * CFrame.Angles(0,0,0) + Vector3.new(10,3,0);
end
end
end
--//
game:GetService("Players").PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local Human = char:WaitForChild("Humanoid");
local HumanRP = char:WaitForChild("HumanoidRootPart");
Human.Died:Connect(function()
spawn(function()
clearItem("Football", char:GetChildren(), HumanRP.CFrame);
end)
clearItem("Football", plr:WaitForChild("Backpack"):GetChildren(), HumanRP.CFrame);
end)
end)
end)
My solution for not making the player equip the tool after they die is spawning it 10 studs away on the X axis of the humanoidRootPart, Which is probably not the most effictive since the body parts are distributed randomly upon death, so there’s a chance one might hit. But this script works fine
it worked thxs If i hired you to be a scripter how much would I pay you? Go check out Ultronlize Studios or Kriptical Studios, if you want proof that I got robux.
I don’t think we should discuss this on a thread, but it’s really about what you’re hiring me to do. Contact me on discord at MightTea#7591