Forum

> > CS2D > Scripts > Sit System Request
Forums overviewCS2D overview Scripts overviewLog in to reply

English Sit System Request

4 replies
To the start Previous 1 Next To the start

old Sit System Request

TheUnrealGamerz
User Off Offline

Quote
My little request for scripting is:

Sit system:
• Use trigger_use
• Press 'E' one the trigger_use or at the side of trigger_use, immediately position on trigger_use.
• Player speed will decreased to 0.
• Player won't move but can turn around until you press 'E' again.

Please make me this script that can automatically used or help me search, thank you.

Admin/mod comment

"Little request pls." is a generic and hence bad title. Fixed! /DC

old Re: Sit System Request

Rainoth
Moderator Off Offline

Quote
Player speed will decrease to 0. That's normal speed. I'll assume that point 3 and 4 are actually one point saying "he can't move". Lua can't control player's rotation as it's in game and not supported by Lua.

Anyways

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
tbl = {}
addhook("usebutton","sit")
function sit(id,x,y) -- Id of the player, position of button in TILES !
	if x == 101 and y == 80085 then -- Where is the button ?
		if tbl[id]==0 then -- If not sitting
			tbl[id]=1 -- Starts sitting
			parse("speedmod "..id.." -100") -- Not moving
		else
			tbl[id]=0 -- Stops sitting
			parse("speedmod "..id.." 0") -- Can move
		end
	end
end

addhook("join","setstate")
function setstate(id)
	tbl[id]=0 -- When player joins, he's not sitting.
end

old Re: Sit System Request

Necr0
User Off Offline

Quote
CODE >

this edit of user Rainoth' code allows you to place seats per map editor by just placing a button named "!seat".
Also it teleports you onto the middle of the tile because elsewise you could sit on every surrounding tile too.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview