Jump to content

trigger event


iwalidza

Recommended Posts

1 hour ago, ๖ۣۜζ͜͡RapGod said:

Hello. Can u please show me some code so i could help you? At least state where you're facing a problem?

 

-- client side

function getGroundPos (x,y)
    local is_hit, hitX, hitY, hitZ = processLineOfSight( x,y, 5000, x,y, -30truefalsefalsetruetruefalsefalsefalsenilfalsefalse )
    if not hitZ then
        return 0
    end
    return hitZ
end
 
function serverGroundPos(x,y)
    z = getGroundPos (x,y)
end
addEvent('getGroundPos',true)
addEventHandler('getGroundPos',root,serverGroundPos)
-- server side
function getGroundPos (player,x,y)
    triggerClientEvent(player,'getGroundPos',player,x,y)
end
 
function returnGroundPos (z)
    return z
end
addEvent('returnGroundPos',true)
addEventHandler('returnGroundPos',root,returnGroundPos)
 
and in exported script
            self.z = main:getGroundPos(source,self.x,self.y)
self.z return nil
 
 
Edited by iwalidza
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...