generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Any way to get the actual AssetId by a script?

Previous Thread :: Next Thread 
Roy_Mer is not online. Roy_Mer
Joined: 13 Jul 2014
Total Posts: 396
23 May 2016 03:15 PM
Is there any way so when you input the ID of a decal, it does the -1 or how many needed to get the actual AssetId by a script?


Report Abuse
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
23 May 2016 03:16 PM
ItemId = 2330811 --That's my UserId, just as an example
AssetId = ItemId - 1
Report Abuse
Roy_Mer is not online. Roy_Mer
Joined: 13 Jul 2014
Total Posts: 396
23 May 2016 03:18 PM
But for instance whether it's a shirt or a decal, something it's -1,-2,-3, not always -1.


Report Abuse
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
23 May 2016 03:20 PM
You can probably get the AssetInfo from the ID and determine what kind of product it is. Use AssetService or MarketplaceService
Report Abuse
Roy_Mer is not online. Roy_Mer
Joined: 13 Jul 2014
Total Posts: 396
23 May 2016 03:23 PM
http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/GetProductInfo

Asset.AssetId still doesn't give me the Id I'm trying to get :/


Report Abuse
Roy_Mer is not online. Roy_Mer
Joined: 13 Jul 2014
Total Posts: 396
23 May 2016 03:24 PM
Well I could match some of the Asset data and if it doesn't get matched I'd make it do another -1 till it matches I guess.


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
23 May 2016 03:27 PM
why not look at free mods?

Here is person299 minigames decal changing commands

decal = script.Parent.Decal

function inform(guy)
local m = Instance.new("Hint")
m.Text = "That is not a valid decal page URL."
m.Parent = guy.PlayerGui
wait(4)
m:remove()
end

game.Players.PlayerAdded:connect(function(p)
p.Chatted:connect(function(msg)

if string.sub(string.lower(msg),1,3) == "ad/" then
local dastring = string.sub(msg,4) --"http://www.roblox.com/Item.aspx?ID=8247268"

if string.sub(dastring,1,1) == " " then
dastring = string.sub(dastring,2)
end

local numba = string.find(dastring,"id=")
if numba ~= nil then

local numba2 = "http://www.roblox.com/asset/?id=" .. tostring(tonumber(string.sub(dastring,numba + 3)) - 1)

for a,b in ipairs(list) do
if b[1] == p then
table.remove(list,a)
end end

table.insert(list,{p,numba2})

pcall(function()
p:SaveNumber("LastAdBoardPost",tonumber(string.sub(dastring,numba + 3)) - 1)
end)

else

inform(p)

end


Report Abuse
Roy_Mer is not online. Roy_Mer
Joined: 13 Jul 2014
Total Posts: 396
23 May 2016 03:39 PM
To be honest I think I'll stick with my thought of matching the decal title or some other asset info.


Report Abuse
Coinye is not online. Coinye
Joined: 19 Jul 2010
Total Posts: 4347
23 May 2016 04:09 PM
local assetId = 417137126
local asset = game:GetService("InsertService"):LoadAsset(assetId)
print(asset.Decal.Texture)


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

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



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image