Jump to content

ObjectLocation


The Cartooners

Recommended Posts

The code below

 

for _,v in ipairs(cartUphillChallenge:GetAllOfType('ZItem')) do

print("Item: " .. v.Name .. " is in location: " .. v.ObjectLocation)

end

 

generates the following error

 

attempt to concatenate ObjectLocation

 

Does anyone know what the problem might be and how do I fix it.

 

Thanks in advance

Edited by The Cartooners
Link to comment

Thats it: tostring

 

Here is the modified code

 

for _,v in ipairs(cartUphillChallenge:GetAllOfType('ZItem')) do

print("Item: " .. v.Name .. " is in location: " .. tostring(v.ObjectLocation))

end

 

which produces an iteration of all items like this

 

Item: Sword is in location ZonePoint(51.xxxxx, -2.xxxxx, Distance(0, 'm'))

etc

etc

 

Hope this helps someone

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...