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

How Do Make The Script That Give An Item When The Player Kill Another Player?

I want to make this script work when a player kill a player and then they receive an item such as coins and others from the dead person and if the killer do not pick up the item, then it will disappear. How am I going to do that?

function Drop() 
local drops = {"item"} 
local G = math.random(1, 1)
local Obj = game.Lighting:findFirstChild(drops[G]):Clone() 
Obj.Parent = game.Workspace 
Obj.Handle.CFrame = script.Parent.Head.CFrame + Vector3.new(5,2,0)  
script:remove()
end 


while true do 
	wait(.1) 
	if (script.Parent.Humanoid.Player.Health <1) then 
		Drop() 
		wait(3)remove
	end 
end


1 comment

0

You are removing the script before it can finish what you're trying to do.

1 answer

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