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

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

Asked by
ImfaoXD 158
9 years ago

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


0
You are removing the script before it can finish what you're trying to do. HungryJaffer 1246 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

This post will show you how to make a leaderboard + how to register kills. http://www.roblox.com/Forum/ShowPost.aspx?PostID=86462009 I think it is better for you to stick with the basic.

Ad

Answer this question