Jump to content

Just a question


DiGiTal

Recommended Posts

You'll have to make variables if you want to use them like that, but you can easily use it without addressing it to the memory.

vehicleT = getElementsByType("vehicle")

for i, k in pairs(vehicleT) do
	outputChatBox(getElementModel(k))
end

for i, k in ipairs(getElementsByType("vehicle")) do
	outputChatBox(getElementModel(k))
end

Both'll work.

Link to comment
On 08/08/2017 at 22:07, Ridden said:

Hi, i'm a basic scripter (learning) . did i need to create a variable for elements :

EX:player=getElementType.  or it's on the client

Thanks

The client has the function getLocalPlayer() aka localPlayer on client side files and that only gets the client player and not any other player while it does get all the players when you trigger it to all of the clients.

Other than your player, you can get specific elements through event parameters and/or getElementsByType function which will return a table of all the specified element type.

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