# properties.Add

- **Ortam:** İstemci, Sunucu
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/properties.Add
- **Çeviri tarihi:** 2025-09-08

```lua
properties.Add( string name, table propertyData )
```

## Açıklama

Özellikler modülüne özellikler ekler. Özellikler [GM:CanProperty](https://gmod.tr/wiki/GM:CanProperty) aracılığıyla engellenebilir.

## Argümanlar

1. [string](https://gmod.tr/wiki/string) **name**: Özelliği tanımlamak için kullanılan benzersiz bir isim
2. [table](https://gmod.tr/wiki/table) **propertyData**: Özelliği tanımlayan bir tablo. [PropertyAdd yapısını](https://gmod.tr/wiki/Structures/PropertyAdd) kullanır.

### Örnek

Varlıkları tutuşturmak için kullanılabilecek bir özelliği tanımlar (Sandbox'tan)

```lua
properties.Add( "ignite", {
	MenuLabel = "#ignite", -- Bağlam menüsünde gösterilecek isim
	Order = 999, -- Bu özelliği diğer özelliklere göre gösterme sırası
	MenuIcon = "icon16/fire.png", -- Özelliğin yanında gösterilecek simge

	Filter = function( self, ent, ply ) -- Bir varlığın bu özellik için geçerli olup olmadığını belirleyen bir fonksiyon
		if ( !IsValid( ent ) ) then return false end
		if ( ent:IsPlayer() ) then return false end
		if ( !CanEntityBeSetOnFire( ent ) ) then return false end
		if ( !gamemode.Call( "CanProperty", ply, "ignite", ent ) ) then return false end

		return !ent:IsOnFire()
	end,
	Action = function( self, ent ) -- Özelliği kullanırken gerçekleştirilecek eylem ( İstemci Tarafı )

		self:MsgStart()
			net.WriteEntity( ent )
		self:MsgEnd()

	end,
	Receive = function( self, length, ply ) -- Özelliği kullanırken gerçekleştirilecek eylem ( Sunucu Tarafı )
		local ent = net.ReadEntity()

		if ( !properties.CanBeTargeted( ent, ply ) ) then return end
		if ( !self:Filter( ent, ply ) ) then return end

		ent:Ignite( 360 )
	end
} )
```

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/properties.Add
