Struggling to get a placeID from assetService

Hello,

I’ve trying to achieve to get a placeID from AssetService:CreatePlaceAsync.

Used pcall function. It succussed but all I got return is nil. I didn’t get a placeID.

Can you help me to get placeId from it?

Here’s my script

And I’ve checked. I got nil in both. Client and server.

local remote = script.Parent
local TemplateID = script.Parent.Parent:WaitForChild("TemplateID")
local assetService = game:GetService("AssetService")

remote.OnServerInvoke = function(player, place, desc)
	local success, result = pcall(function()
		assetService:CreatePlaceAsync(place, TemplateID.Value, desc)
	end)
	
	if success then
		task.wait(2)
		return true, result
	else
		task.wait(2)
		return false, result
	end
end

You need to add return to line 7 (prior to assetService…).

1 Like

Oh. I realized. Thank to you. It worked now.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.