Forum

> > CS2D > Scripts > Machete on mouse
Forums overviewCS2D overview Scripts overviewLog in to reply

English Machete on mouse

6 replies
To the start Previous 1 Next To the start

old Machete on mouse

Mami Tomoe
User Playing CS2D

Quote
Hello all!
I have a problem and I need help plz

I have a script that is giving machete explode when used on ground but
I have this:
1
2
3
4
5
6
7
8
9
10
if w == 69 then
			rot = player(id,"rot")
			if rot < -90 then rot = rot + 360 end
			local angle = math.rad(math.abs(rot + 90)) - math.pi
			local x = player(id,"x") + math.cos(angle) * itemtype(w,"dmg") / 2
			local y = player(id,"y") + math.sin(angle) * itemtype(w,"dmg") / 2
			if x > 0 and y > 0 and x < map("xsize") * 32 and y < map("ysize") * 32 then
				parse("explosion "..x.." "..y.." 32 10000000 "..id)
			end
		end
but it won't hit on me mouse and I want it to
I think I need to use the hook clientdata on me script but I don't know how

plz help? plz i make u vip on server plz
edited 1×, last 20.11.16 07:27:42 pm

old Re: Machete on mouse

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("attack","boom")
function boom(id)
	if player(id,"weapontype") == 69 then
		for i=1,4 do
			timer(500*i,"parse","explosion "..player(id,"x")+math.floor(3*i*math.cos(unitangle(player(id,"rot")))*32) .." "..player(id,"y")+math.floor(3*i*math.sin(unitangle(player(id,"rot")))*32) .." 64 35 "..id)
		end
	end
end

function unitangle(rot)
 if rot<-90 then rot=rot+360 end
 local angle=math.rad(math.abs(rot+90))-math.pi
 return angle
end
An old script from a couple years back. Might help you.

And another one that seems to accomplish something similar to what you're asking for.
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("clientdata","testingthis")
function testingthis(id,mode,d1,d2)
	if mode==2 then
		parse("explosion "..d1.." "..d2.." 100 100 "..id)
	end
end

addhook("second","requestdata")
function requestdata()
	for _, id in pairs(player(0,"tableliving")) do
		reqcld(id, 2)
	end
end

old Re: Machete on mouse

Rainoth
Moderator Off Offline

Quote
Omg yes I've always dreamed of being VIP. Add me please
Don't write the name. I'll be on the 1 in a million chance that it'll still be hosted by the time I decide to play CS2D.

old Re: Machete on mouse

Rainoth
Moderator Off Offline

Quote
It's really simple, just copy-paste your own file and change your usgn ID into mine ^,o

old Re: Machete on mouse

Mami Tomoe
User Playing CS2D

Quote
ok ill try wait

edit: ok i think i did it and i wait when you visit for your new vip! and you have 500$ too free because i forgot default money

ok bye!
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview