Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How may I get this to load model assets that players have created, not from roblox?

Asked by 9 years ago

So, I have tried to put in models that I have made to load out when the script is in use, that dosen't work. So far, only using roblox models will work when you use the script. How can I get it to where it will load player models? This is what the script looks like so far:


ids = {93601062,95401558} local Tool = script.Parent; function insert() local randID = ids[math.random(#ids)] --#ids is the number of values in the table local root = game:GetService("InsertService"):LoadAsset(randID) --Load the random ID. local instances = root:GetChildren() if #instances == 0 then root:Remove() return end --Continue the insert process root.Name = "InsertedObject" .. randID game:GetService("InsertService"):Insert(root) local t = game.Players.LocalPlayer.Character:FindFirstChild("Torso") if t == nil then return end --Make sure that the script doesn't error if the torso is not found root:MoveTo(t.Position + t.CFrame.lookVector * 8) Tool.Handle.Drop:Play() end enabled = true function onButton1Down(mouse) if not enabled then return end enabled = false insert() wait(.01) Tool:Remove() end function onEquippedLocal(mouse) if mouse == nil then print("Mouse not found") return end mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end Tool.Equipped:connect(onEquippedLocal)

1 answer

Log in to vote
0
Answered by 9 years ago

For a while, InsertService only allows you can only insert objects that are either verified by ROBLOX, are from ROBLOX or are made by the game creator themselves.

There's not much you can do to get around this, but maybe taking someone's model and republishing it could work in your case. Just make sure to use your model's ID instead of theirs, otherwise it won't work.

Although I highly advise against this as it's practically stealing someone's work.

Ad

Answer this question