Jump to content

help at getDistanceBetweenPoints3D


K4stic

Recommended Posts

totalDist = getDistanceBetweenPoints3D ( x, y, z, x2, y2, z2 ) 
paycheck = math.floor(tonumber(totalDist*100 )) 
totalPay = givePlayerMoney ( hitElement, (paycheck) ) 

it says me line 2: attempt to perform arithmetic on giobal 'totalDist' (a boolean value)

Link to comment

output me false at chatbox

code of cordinates+the previus code

local x, y, z = getElementPosition( player ) 
local x2, y2, z2 = unpackbriefmark ( ) 
totalDist = getDistanceBetweenPoints3D ( x, y, z, x2, y2, z2 ) 
outputChatBox ( tostring(totalDist) ) 
paycheck = math.floor(tonumber(totalDist*100 )) 
totalPay = givePlayerMoney ( hitElement, (paycheck) ) 

Edited by Guest
Link to comment
output me false at chatbox

code of cordinates+the previus code

local x, y, z = getElementPosition( player ) 
local x2, y2, z2 = unpackbriefmark ( ) 
totalDist = getDistanceBetweenPoints3D ( x, y, z, x2, y2, z2 ) 
outputChatBox ( tostring(totalDist) ) 
paycheck = math.floor(tonumber(totalDist*100 )) 
totalPay = givePlayerMoney ( hitElement, (paycheck) ) 

You're using player at line 1 and hitElement at line 6. i guess this is the problem.

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...