iwalidza Posted February 5, 2022 Share Posted February 5, 2022 i make new getGroundPosition() its in client side how i can return the value in server side and make export function for it Link to comment
๖ۣۜζ͜͡RapGod Posted February 5, 2022 Share Posted February 5, 2022 (edited) 1 hour ago, iwalidza said: i make new getGroundPosition() its in client side how i can return the value in server side and make export function for it Hello. Can u please show me some code so i could help you? At least state where you're facing a problem? Edited February 5, 2022 by ๖ۣۜζ͜͡RapGod Link to comment
iwalidza Posted February 5, 2022 Author Share Posted February 5, 2022 (edited) 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, -30, true, false, false, true, true, false, false, false, nil, false, false ) 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 February 5, 2022 by iwalidza Link to comment
๖ۣۜζ͜͡RapGod Posted February 5, 2022 Share Posted February 5, 2022 (edited) Sorry i misread your script,and posted a wrong comment. Please try using those <> to help us read your code in a better way(better view). Edited February 5, 2022 by ๖ۣۜζ͜͡RapGod Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now