Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

entities() E2 function #3257

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lua/entities/gmod_wire_expression2/core/entity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ e2function entity entity:owner()
return getOwner(self, this)
end

__e2setcost(100)

e2function array entities()
local entities = ents.GetAll()
self.prf = self.prf + #entities / 2

return entities
end

__e2setcost(20)

e2function table entity:keyvalues()
Expand Down
1 change: 1 addition & 0 deletions lua/wire/client/e2descriptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ E2Helper.Descriptions["hashSHA256(s)"] = "Returns the SHA256 hash of the input s

-- Entity/Player
E2Helper.Descriptions["entity(n)"] = "Gets the entity associated with the id"
E2Helper.Descriptions["entities()"] = "Returns an array containing all entities on the map"
E2Helper.Descriptions["owner()"] = "Gets the owner of the expression ( same as entity():owner() )"
E2Helper.Descriptions["id(e:)"] = "Gets the numeric id of an entity"
E2Helper.Descriptions["noentity()"] = "Returns an invalid entity"
Expand Down
Loading