Jump to content

[HELP] Why is this script not working?


Recommended Posts

Posted (edited)

This is my anti zombie zone

But when i enter with skin 285 i die to?

While i did:

if skin == 115 or 285 then

Here is the code:

a51gate1 = createObject ( 980, 1500.7756347656, -1441.1220703125, 9.4062042236328, 0, 0, 272 )
a51col = createColCuboid ( -66.439483642578, 1479.7907714844, 12.388235092163, 150, 150, 100 )
 
function opena51gates(hitPlayer,thePlayer)
local skin = getElementModel (hitPlayer)
if skin == 115 or 285 then
moveObject (a51gate1, 1000, 1500.7756347656, -1441.1220703125, 9.4062042236328 )
else
killPed (hitPlayer)
end
end
addEventHandler( "onColShapeHit", a51col, opena51gates )
 
function closea51gates(hitPlayer,thePlayer)
local skin = getElementModel (hitPlayer)
if not skin == 115 or 285 then
killPed (hitPlayer)
moveObject (a51gate1, 1000, 1500.7756347656, -1441.1220703125, 9.4062042236328 )
end
end
addEventHandler( "onColShapeLeave", a51col, closea51gates )

]

Regards,

Jesseunit

Edited by Guest
Posted
what doesnt work?:P

i edited it

this is not an answer for question above o_O

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted
JasseUnit, you can't do an if statement like this because 285 is a number and will pass as true. You have to check if skin is 285 again.
if ( skin == 115 ) or ( skin == 285 ) then

k thanks

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...