Forum

> > CS2D > Scripts > [LUA]Item drop based on percentage
Forums overviewCS2D overview Scripts overviewLog in to reply

English [LUA]Item drop based on percentage

No replies
To the start Previous 1 Next To the start

old closed [LUA]Item drop based on percentage

Casper-
User Off Offline

Quote
> Sorry for the thread spam, figured it out
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("die","randomChance")
function randomChance(id,killer,weapon,x,y)
	local R=math.random(1,20)
	
	if R>=1 and R<=10 then
	-- RPG
	parse("spawnitem 47 "..player(id,"tilex").." "..player(id,"tiley").." ")
	parse("sv_soundpos \"SFsfx 4.wav\" "..player(id,"x").." "..player(id,"y").." ")
	parse("effect \"flare\" "..player(id,"x").." "..player(id,"y").." 5 16 150 150 255")
	
	
	end
end

-------
Spoiler >
edited 2×, last 28.06.23 12:15:17 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview