DiGiTal Posted August 8, 2017 Share Posted August 8, 2017 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 Link to comment
NeXuS™ Posted August 8, 2017 Share Posted August 8, 2017 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
_DrXenon Posted August 9, 2017 Share Posted August 9, 2017 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
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