Learn
Motor Sınıfı
PolicyService
Oluşturulamaz
Hizmet
Çoğaltılmamış

*Bu içerik, yapay zekâ (beta) kullanılarak çevrildi ve hatalar içerebilir. Sayfayı İngilizce görüntülemek için buraya tıkla.


Özet
Devralınan Üyeler

API Referansı
Yöntemler
CanViewBrandProjectAsync
Bekletir
Capabilities: Basic
PolicyService:CanViewBrandProjectAsync(
player:Player, brandProjectId:string
Parametreler
player:Player
brandProjectId:string
Dönüşler
Kod Örnekleri
Sunucu tarafı kod örneği
-- ServerScriptService'de
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PolicyService = game:GetService("PolicyService")
-- ReplicatedStorage'de önceden oluşturulmuş RemoteEvent
local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
local brandedAsset = ReplicatedStorage:WaitForChild("BrandedAsset")
local defaultAsset = Instance.new("Part")
Players.PlayerAdded:Connect(function(player)
-- PolicyService:CanViewBrandProjectAsync yalnızca Sunucudan çağrılabilir
local success, canView = pcall(function()
return PolicyService:CanViewBrandProjectAsync(player, "BRP-0123456789")
end)
if success and canView then
RemoteEvent:FireClient(player, brandedAsset)
else
RemoteEvent:FireClient(player, defaultAsset)
end
end)
İstemci tarafı kod örneği
-- StarterPlayerScripts içinde
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- ReplicatedStorage içinde önceden oluşturulmuş RemoteEvent
local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
RemoteEvent.OnClientEvent:Connect(function(partToLoad)
local clonedPart = partToLoad:Clone()
clonedPart.Parent = workspace
end)

GetPolicyInfoForPlayerAsync
Bekletir
Capabilities: Basic
PolicyService:GetPolicyInfoForPlayerAsync(player:Instance):Dictionary
Parametreler
player:Instance
Dönüşler
Kod Örnekleri
Bir Oyuncu için Politika Bilgisi Alma
local PolicyService = game:GetService("PolicyService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local success, result = pcall(function()
return PolicyService:GetPolicyInfoForPlayerAsync(player)
end)
if not success then
warn("PolicyService hatası: " .. result)
elseif result.ArePaidRandomItemsRestricted then
warn("Oyuncu ücretli rastgele öğe oluşturucularıyla etkileşimde bulunamaz")
end
Bir Oyuncu için Politika Bilgisi Alma
local PolicyService = game:GetService("PolicyService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local success, result = pcall(function()
return PolicyService:GetPolicyInfoForPlayerAsync(player)
end)
if not success then
warn("PolicyService hatası: " .. result)
elseif not result.IsEligibleToPurchaseCommerceProduct then
warn("Oyuncu ticaret ürünlerini satın almak için uygun değil")
end

©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.