Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i stop my drop script from droping Pizza on every death?

Asked by 3 years ago
Edited 3 years ago

Hi. I have been trying for awhile to get edit my script to only drop pizza when killed by another player.

it currently drops when ever a player dies

any help/pointers are appreciated

i think the changes need to be made here-----


local char = script.Parent local hum = char.Humanoid local players = game.Players local pizza = game.ReplicatedStorage.Pizza local debounce = false hum.Died:Connect(function() local player = players:GetPlayerFromCharacter(char) pizza.CFrame = char.HumanoidRootPart.CFrame pizza:Clone().Parent = game.Workspace game.Workspace.Pizza.Touched:Connect(function(hit) local otherPlayer = players:GetPlayerFromCharacter(hit.Parent) local otherHum = hit.Parent:FindFirstChild("Humanoid") if otherHum and otherHum ~= hum and not debounce then debounce = true

------- within here

Thanks credit for the current code https://www.youtube.com/watch?v=b-D4HBIQ0LQ

Answer this question