quadrinka4 Posted August 13, 2016 Share Posted August 13, 2016 (edited) local player = getPlayer(); local px = getPlayer():getX(); local py = getPlayer():getY(); if (px == 10994 && py == 9647) then player:Say("here i am"); end Hello everyone, in this code I am trying to make a player say "here i am" when its function is executed at certain location. however, the console keep giving me there's an error at line 5 saying " ')' expected to be near & " . Could anyone help me to fix this problem? Thank you in advance. Edited August 16, 2016 by quadrinka4 Link to comment Share on other sites More sharing options...
RoboMat Posted August 13, 2016 Share Posted August 13, 2016 Lua doesn't use && like java ... you have to use and local player = getPlayer(); local px = getPlayer():getX(); local py = getPlayer():getY(); if (px == 10994 and py == 9647) then player:Say("here i am"); end quadrinka4 1 Link to comment Share on other sites More sharing options...
quadrinka4 Posted August 13, 2016 Author Share Posted August 13, 2016 11 minutes ago, RoboMat said: Lua doesn't use && like java ... you have to use and local player = getPlayer(); local px = getPlayer():getX(); local py = getPlayer():getY(); if (px == 10994 and py == 9647) then player:Say("here i am"); end Thank you ^^!! is there also a way to make the function to check not the exact that spot but within 3 blocks of that spot?? Link to comment Share on other sites More sharing options...
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