Item appears in game but not in studio

Hey Devs,

There’s this problem I’m having in Studio where a panda plushie appears on the floor in my game only when I press play. Its not in studio, and doesn’t show up in the explorer when the game is not run. Once I run the game it shows up under Workspace, and also under lighting. How do I get rid of this?

I should also mention that I have a panda gamepass item, but I also have a bunch of other gears using the same gamepass scripts. This is the only item that is having this problem.
Screen Shot 2022-12-30 at 2.13.46 PM

It may be because you didn’t publish the version of the game with this bug, do you have team create on?

No I do not have team create, but it appears in game as well.

Can you send the script because only a script could do something like that at least in my opinion

Edit sorry for grammar it’s night in my timezone and I’m half asleep

Wait, if it’s not in explorer then where your script takes the model from?

I should have said that it duplicates it from Server Storage and gives it to the player

local Players = game:GetService("Players")

local gamePassID = 116265106 --Replace this set of numbers with your gamepass id
 
function onPlayerSpawned(player) 
    
    local hasPass = false
 
    local success, message = pcall(function()
        hasPass = MarketplaceService:UserOwnsGamePassAsync(player.userId, gamePassID)
    end)
-- The script below is for checking whether or not the player has the gamepass.
    if not success then
        warn("Error while checking if player has pass: " .. tostring(message))
        return
    end
 
    if hasPass == true then
		game.ServerStorage["Panda Plushie"]:clone().Parent = player.Backpack --replace "SuperFlyGoldBoombox" with your item
 end
end 

game.Players.PlayerAdded:connect(function(player)
  player.CharacterAdded:connect(function()
    onPlayerSpawned(player)
  end)
end)

Players.PlayerSpawned:Connect(onPlayerSpawned)

This one is to prompt the purchase.

local ITEM_ID = 116265106
local Click = Instance.new("ClickDetector",CLICK_BLOCK)

Click.MouseClick:connect(function(p)
	game:GetService("MarketplaceService"):PromptGamePassPurchase(p,ITEM_ID)
end)

I hit “Zoom to” in the ServerStorage and it took me right where the item was randomly spawning when I hit play. This image is before I hit play, once I hit play the plushie spawns where the arrows are.

Can you change Lighting service name to something else and turn on output because if a script is doingplushie.Parent = game.Lighting then it will cause an error and you will be able to spot a gap in code but if the code uses game:GetService("Lighting") then it won’t work

What do you mean, Im not good with scripting. Where do I change the name?

Press Lighting in Explorer then press F2 on your keyboard and change the name to something else. Later you will be able to rename it to Lighting back. You can turn on Output in View tab it will show all output from scripts including errors

I hope this was what you were requesting?

This is what I found regarding the panda when I pressed play.

Can you sen that script called “Panda Script”? It looks like it’s the problem

Edit: You can also change the name of Lighting back to Lighting, it was for debugging purposes

Your issue is that you are cloning and parenting in the same step:

Instead do this:

local clonePanda = game.ServerStorage["Panda Plushie"]:clone()
clonePanda.Parent = player.Backpack

Edit: on top of this, your issue is with an item named Panda Poker, not Panda Plushie… so these scripts and what you showed us are irrelevant… you need to find the script that is referencing Panda Poker, which is in a script also called Panda Script.

This didn’t really seem to fix the issue of the panda just spawning on the floor.

This issue isn’t happening with any other of my game passes. I think the model itself is just broken…

Type Ctrl+Shift+F and then put in PandaPoker, it will show you scripts that contain this, and you can start to get to the bottom of this.

I deleted everything to do with the panda gamepass, it still appears in game. There were no more panda scripts or any model left. And as soon as I hit play it just adds in a panda model.