Forum

> > CS2D > Scripts > Player can jump Obstacles
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Player can jump Obstacles

20 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt Player can jump Obstacles

DragonAwper
User Off Offline

Zitieren
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

alt Re: Player can jump Obstacles

Apache uwu
User Off Offline

Zitieren
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.

Mehr >

alt Re: Player can jump Obstacles

Starkkz
Moderator Off Offline

Zitieren
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.
2× editiert, zuletzt 04.09.11 20:25:55

alt Re: Player can jump Obstacles

Starkkz
Moderator Off Offline

Zitieren
user X-Files hat geschrieben
addhook("always",Always")

true


addhook("always","Always")


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

alt Re: Player can jump Obstacles

Yates
Reviewer Off Offline

Zitieren
user 3RROR hat geschrieben
user X-Files hat geschrieben
"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.

alt Re: Player can jump Obstacles

IWhoopedPythagoras
BANNED Off Offline

Zitieren
user Apache uwu hat geschrieben
user IWhoopedPythagoras hat geschrieben
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.

alt Re: Player can jump Obstacles

Apache uwu
User Off Offline

Zitieren
user IWhoopedPythagoras hat geschrieben
user Apache uwu hat geschrieben
user IWhoopedPythagoras hat geschrieben
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
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht