Jump to content
Sign in to follow this  
Jones

Gain an item after killing a player in a map

Recommended Posts

Simple script

 

-- Put this script in -->> function after_player_kill_player( ATKER, DEFER ) with the others.

(functions.lua)

 

	if map_name_ATKER == "chaosicicle" or map_name_DEFER == "chaosicicle" then -- Change the map that you want to put in here
		local atk_name = GetChaDefaultName ( ATKER )
		local def_name = GetChaDefaultName ( DEFER )
		local Notice_all = "["..def_name.."] was slain by ["..atk_name.."] in Chaos Icicle (55)!" -- Notices the world that [x] killed [x]. You can change the messages here.
		Notice ( Notice_all )
		GiveItem (ATKER , 0 , 3333 , 1 , 4 ) -- 3333 = Item ID, you can modify this.
		GiveItem (ATKER , 0 , 3334 , 1 , 4 ) -- 3334 = Item ID, if you want to add more, copy and paste under with Item ID.
	end

 

I hope someone finds this helpful, i understand it's very simple xD

 

  • Like 3

Share this post


Link to post
Share on other sites

I am pretty sure you would want to change or operator for the map check to an and. I mean it's hard to tell without having the rest of the code, but you'd want both attacker and defer to be on the same map?

if map_name_ATKER == "chaosicicle" AND map_name_DEFER == "chaosicicle" then

Edited by patrick13
  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...