Forum

> > CS2D > Scripts > Strip on Teleport
Forums overviewCS2D overview Scripts overviewLog in to reply

English Strip on Teleport

8 replies
To the start Previous 1 Next To the start

old Strip on Teleport

Computerguy419
User Off Offline

Quote
I would like a script that will strip all weapons form the player that teleports. The teleporter is named "tel".

√ Computerguy419

old Re: Strip on Teleport

Apache uwu
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
stripSpots={}

for x,y in pairs(entitylist()) do
	if entity(x,y,"name")=="tel" then
		stripSpots[x.." "..y]=true
	end
end

addhook("movetile","_movetile")

function _movetile(id,x,y)
	if stripSpots[x.." "..y] then
		for _,wpn in pairs(playerweapons(id)) do
			parse("strip "..id.." "..wpn)
		end
	end
end

old Re: Strip on Teleport

Apache uwu
User Off Offline

Quote
It does work if it's standalone, make sure you do not have any conflicting hooks or variables.

By the way: You can't strip knife, wrench, bomb, etc.

old Re: Strip on Teleport

Computerguy419
User Off Offline

Quote
Here is your code

stripSpots={}

for x,y in pairs(entitylist()) do
if entity(x,y,"name")=="tel" then
stripSpots[x.." "..y]=true
end
end

addhook("movetile","cpuguy.movetile")

function cpuguy.movetile(id,x,y)
if stripSpots[x.." "..y] then
for _,wpn in pairs(playerweapons(id)) do
parse("strip "..id.." "..wpn)
end
end
end

Here is my other codes

addhook("buildattempt","cpuguy.FUBuild")
addhook("objectupgrade","cpuguy.FUpgrade")

function cpuguy.FUBuild(p,t,x,y,i)
if t==20 or t==21 then
return 0
end
parse('spawnobject '..t..' '..x..' '..y..' 0 0 '..player(p,"team")..' '..p)
return 1
end

function cpuguy.FUpgrade(i,p,g,t)
t=object(i,"type")

if t==1 then t=3
elseif t==3 then t=4
elseif t==4 then t=5
elseif t==8 then t=11
elseif t==11 then t=12
elseif t==9 then t=15 end

n=player(p,"team")
x=object(i,"tilex")
y=object(i,"tiley")

old Re: Strip on Teleport

Computerguy419
User Off Offline

Quote
sry that wasn't all of the Code:

r=object(i,"rot")
m=object(i,"mode")
d=object(i,"player")

parse("killobject "..i)
parse("spawnobject "..t.." "..x.." "..y.." "..r.." "..m.." "..n.." "..p)
return 1
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview