09-28-2014, 08:42 PM
I need to compare 2 position variables, and they are always diferent because they are X.135369.. Or Z.168375
Any way to solve this?
Any way to solve this?
Get player coords with no decimals
|
||||||
09-28-2014, 08:42 PM
I need to compare 2 position variables, and they are always diferent because they are X.135369.. Or Z.168375
Any way to solve this?
09-28-2014, 08:55 PM
This should work:
Thanks given by: tonibm19
09-28-2014, 09:39 PM
Either that, or use Lua's built-in math.floor() or math.ceil() functions.
Thanks given by: tonibm19
09-28-2014, 09:50 PM
Do they work with Vectors?
09-29-2014, 04:19 PM
And anyway, what is it that you're trying to do? Wouldn't it be eaiser to check if the distance between the two positions, if it's below a threshold?
09-30-2014, 12:02 AM
I need to compare a variable to the players position, and if its the same , teleport to another position (in a variable)
The code STR said worked fine, would your code be less performance-heavy doing it every tick as I do now?
09-30-2014, 12:21 AM
Doesn't really matter, they perform roughly the same.
10-05-2014, 03:27 AM
Oh this should also work btw:
| ||||||
« Next Oldest | Next Newest »
|