English Strip on Teleport

8 replies
Goto Page
To the start Previous 1 Next To the start
11.03.12 11:02:09 pm
Up
Computerguy419
User
Offline Off
I would like a script that will strip all weapons form the player that teleports. The teleporter is named "tel".

√ Computerguy419
-=8BA=- Computerguy419
11.03.12 11:10:28 pm
Up
Apache uwu
User
Offline Off
Code:
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
12.03.12 02:14:07 am
Up
Computerguy419
User
Offline Off
This is not working is there something that I have to edit?
-=8BA=- Computerguy419
12.03.12 02:17:53 am
Up
Apache uwu
User
Offline Off
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.
12.03.12 02:28:15 am
Up
Computerguy419
User
Offline Off
so if I change _movetile to cpuguy like all my other ones it will work?
-=8BA=- Computerguy419
12.03.12 02:31:27 am
Up
Apache uwu
User
Offline Off
It does not take much to conflict. See what work, on failure post entire script here.
12.03.12 02:40:41 am
Up
Computerguy419
User
Offline Off
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")
-=8BA=- Computerguy419
12.03.12 02:43:45 am
Up
Apache uwu
User
Offline Off
looks fine however your code is missing an end.
12.03.12 02:48:11 am
Up
Computerguy419
User
Offline Off
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
-=8BA=- Computerguy419
To the start Previous 1 Next To the start