game:GetService("InsertService"):LoadAsset(2705728647).Parent=workspace
idk why this isn’t spawning in anyting
game:GetService("InsertService"):LoadAsset(2705728647).Parent=workspace
idk why this isn’t spawning in anyting
Is it necessary to load the asset? Why can’t you just get the asset and insert it from the toolbox?
Looking at the asset page, it is available for you to get the script (it’s also not a very efficient script. I honestly wouldn’t recommend using it, or at least making a few changes to it).
--// I, AmoraFolf, wrote this code myself. No need to keep this here. Just wanted to mention if it wasn't obvious :)
local Players = game:GetService("Players")
local badgeService = game:GetService("BadgeService")
local badges = {
JoinBadge = 000000; --// Change this to your badge's ID
} --// A table to keep all of your badge IDs neat
local function PlayerAdded(player: Player)
local success, hasJoinBadge, errorMessage = pcall(function() --// A safety net in case the UserHasBadgeAsync call fails. This should be done with anything that has "Async" in it
if not badgeService:UserHasBadgeAsync(player.UserId, badges.JoinBadge) then --// Checks if the user has the badge or not
return true --// Sets the hasJoinBadge variable above to true, which is only done if the user DOES NOT have the badge
else
return false --// Sets the hasJoinBadge variable above to true, which is only done if the user HAS the badge
end
end)
if not hasJoinBadge then --// Checks if hasJoinBadge is true
task.wait(0.5) --// Waits half of a second
badgeService:AwardBadge(player.UserId, badges.JoinBadge) --// Awards the badge. This is only done if hasJoinBadge is false
end
end
Players.PlayerAdded:Connect(PlayerAdded)
And not to mention, you can’t insert assets that aren’t yours. So you really shouldn’t be trying anyway
I saw it on a tutorial. But how would you do it? Ik it’s not affect but why isn’t this working?
Probably because you didn’t allow your game to get and request API. Go to Game Settings → Security → Enable Studio Access To API Services
Try this:
game:GetService("InsertService"):LoadAsset(2705728647):GetChildren()[1].Parent = workspace
It could be as @AlternativeOrNot said. Your game may not be allowing API requests.
If that isn’t an issue, can you show me any error message if you get one? If you don’t get error messages, then let me know.
When using InsertService
, You are only allowed to Insert Items you own, If you do not own an Item that you are trying to Insert, it wont work, However there is only one Exception to this Rule, which is Roblox Owned Items.
The Most Common Error You’ll see is:
"HTTP 403 (Forbidden)"
Which means you are trying to access something you do not have permission for, you can find this Info Here:
Also, I Recommend using a pcall
because you are sending an HTTP Request, which can fail.
local InsertSvc = game:GetService("InsertService") -- Service
-- Prevents Errors so you can Properly Handle them:
local success, result = pcall(InsertSvc.LoadAsset, InsertSvc, 2705728647)