Forum

> > CS2D > Scripts > Player can jump Obstacles
Forums overviewCS2D overview Scripts overviewLog in to reply

English Player can jump Obstacles

20 replies
Page
To the start Previous 1 2 Next To the start

old Player can jump Obstacles

DragonAwper
User Off Offline

Quote
I Saw some Scripts that the player can jump obstacles, like on the Crysis 2D: 2 by Starkkz.
I read his Script but i didn't understand very well.

> I Want a Script that the players can Jump Obstacles when a ServerAction is Pressed.

Thanks

old Re: Player can jump Obstacles

Apache uwu
User Off Offline

Quote
It's basically wall hack over obstacles, when you tab the use button it drains your energy until it runs out or if you tap e again.

It's really bugged since when you try to move while it's "jumping" it will lag your movements.

I don't recommend any game or game mod to have this feature.

More >

old Re: Player can jump Obstacles

Starkkz
Moderator Off Offline

Quote
Try this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Air_Speed = 3
Air_Timer = 2500
PAir_Timer = {}
PSpeed = {}

function Millisecs()
	return os.clock() * 1000
end

addhook("always","Always")
function Always()
	for _, id in pairs(player(0,"table")) do
		if Millisecs() - PAir_Timer[id] <= 0 then
			local rad = math.rad(player(id,"rot"))
			local x = player(id,"x") + math.sin(rad) * Air_Speed
			local y = player(id,"y") - math.cos(rad) * Air_Speed
			if not tile(math.floor(x/32),player(id,"tiley"),"wall") then
				parse("setpos "..id.." "..x.." "..player(id,"y"))
			end
			if not tile(player(id,"tilex"),math.floor(y/32),"wall") then
				parse("setpos "..id.." "..player(id,"x").." "..y)
			end
		else
			if PSpeed[id] and PSpeed[id] == -100 then
				PSpeed[id] = 0
				parse("speedmod "..id.." 0")
			end
		end
	end
end

addhook("use","Jump")
function Jump(id)
	PAir_Timer[id] = Millisecs() + Air_Timer
	PSpeed[id] = -100
	parse("speedmod "..id.." -100")
end

You may press "E" to jump.
edited 2×, last 04.09.11 08:25:55 pm

old Re: Player can jump Obstacles

Starkkz
Moderator Off Offline

Quote
user X-Files has written
addhook("always",Always")

true


addhook("always","Always")


I haven't noticed because I wasn't using an editor, anyways is not a GREAT bug.

old Re: Player can jump Obstacles

Yates
Reviewer Off Offline

Quote
user 3RROR has written
user X-Files has written
"I wasn't using an editor"

me too just note pad

Lol. Even Notepad's a editor program.
But it's pure shit.

I use Notepad ++
But normal notepad on every standard windows computer does suck. I agree.

old Re: Player can jump Obstacles

IWhoopedPythagoras
BANNED Off Offline

Quote
user Apache uwu has written
user IWhoopedPythagoras has written
I wouldn't recommend to use the always hook... It's just buggy and shit.


Actually if you want setpos to be smooth for client side using always is the best.


Using timers is better. This will generate less overhead.
It's not wrong to use always hook, just be careful with it.. Sending images every 1/50 s can really cause lag for players and the server.

old Re: Player can jump Obstacles

Apache uwu
User Off Offline

Quote
user IWhoopedPythagoras has written
user Apache uwu has written
user IWhoopedPythagoras has written
I wouldn't recommend to use the always hook... It's just buggy and shit.


Actually if you want setpos to be smooth for client side using always is the best.


Using timers is better. This will generate less overhead.
It's not wrong to use always hook, just be careful with it.. Sending images every 1/50 s can really cause lag for players and the server.


Well no, using something like timer(1--would just kill your internet just for jumping. On about 150-200 ping always will be much smoother. And for images it should never be put on always...unless it's like 1 image lol
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview