Jump to content

isElementWithinColShape


murilo2929

Recommended Posts

I am trying to make sure that when a player is not in isElementWithinColShape a message appears stating that it is not in the right place but not working how can I do it?

local mechanic = isElementWithinColShape( localPlayer, mecanico )

if not mechanic then
			outputChatBox("TEST", 255, 0, 0)

this is just part of the code saying how I did it, I already set where is the sphere and everything

Link to comment
5 hours ago, murilo2929 said:

I am trying to make sure that when a player is not in isElementWithinColShape a message appears stating that it is not in the right place but not working how can I do it?


local mechanic = isElementWithinColShape( localPlayer, mecanico )

if not mechanic then
			outputChatBox("TEST", 255, 0, 0)

this is just part of the code saying how I did it, I already set where is the sphere and everything

local col = createColRectangle ( X, Y, 15, 15 )
addEventHandler("onColShapeHit",col,function(hitElement,MD)

outputChatBox("Your now im the zone mayneeeeeeeeeeeeeeeeeeeeeeeeeee",hitElement, 255, 0, 0)

end)

addEventHandler ( "onColShapeLeave", col, function(thePlayer)
if isElementWithinColShape( thePlayer, col ) then
outputChatBox("Your not im the zone mayneeeeeeeeeeeeeeeeeeeeeeeeeee",thePlayer, 255, 0, 0)
end
end)

This should work

Edited by Network
Fixed something
Link to comment
14 hours ago, Network said:

local col = createColRectangle ( X, Y, 15, 15 )
addEventHandler("onColShapeHit",col,function(hitElement,MD)

outputChatBox("Your now im the zone mayneeeeeeeeeeeeeeeeeeeeeeeeeee",hitElement, 255, 0, 0)

end)

addEventHandler ( "onColShapeLeave", col, function(thePlayer)
if isElementWithinColShape( thePlayer, col ) then
outputChatBox("Your not im the zone mayneeeeeeeeeeeeeeeeeeeeeeeeeee",thePlayer, 255, 0, 0)
end
end)

This should work

don't  work dude

Link to comment
2 hours ago, murilo2929 said:

don't  work dude

Network has sent you a code that is server side. Be aware of that.

Otherwise, with a simple comment which says "doesn't work" we can not do anything. You could bring more info about the issue like the debug messages or whatever.

Regards.

Link to comment

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