mongui Posted June 16, 2016 Share Posted June 16, 2016 hi guys , i'm new to scripting , this error keeps coming up : getteam name expected team at argument 1 got boolean function distance () local players = getElementsByType ("player") for i,p1 in ipairs(players) do local team1 = getPlayerTeam( p1 ) local name1 = getTeamName(team1) for k,p2 in ipairs(players) do local team2 = getPlayerTeam(p2) local name2 = getTeamName(team2) if ( name1 ~= name2 ) then x1,y1,z1 = getElementPosition x2,y2,z2 = getElementPosition if ( getDistanceBetweenPoints3D (x1 , y1 , z1 , x2 , y2 , z2 ) <= 50 ) then local resource = getResourceFromName (blip) startResource (resource) setTimer(stopResource (resource), 5000 , 1 ) end end end end end Link to comment
KariiiM Posted June 16, 2016 Share Posted June 16, 2016 (edited) This code make no sense in my head, can you explain your problem well? Edited June 20, 2016 by Guest Link to comment
mongui Posted June 20, 2016 Author Share Posted June 20, 2016 i want to check distance between a player and all other players from the other team then start a resource if it's under 50 , it gives a bad argument error line 5 and 8 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