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.
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)
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
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
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.
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.