so the output tells me the character is not a valid member of workspace. How do i fix this?
here is the section of the script:
if script.Parent then
if not script.Parent:IsA("Script") or not script.Parent.Name == "StarterGear" then
local debris = game:GetService("Debris")
local backpack = script.Parent
local player = backpack.Parent
while player.Character == nil do wait() end
local character = player.Character
if character then
while character:FindFirstChild("Humanoid") == nil do wait() end
local hum = character:FindFirstChild("Humanoid")

10 comments
if character.Parent == game.Workspace then
doesnt work'
Don't wait for character on a loop. Wait for it using the CharacterAdded event.
Player.CharacterAdded:Wait() ^
have you defined the player? like
have you defined the player? like local.Humanoid = player or something?
@OnceLegend has a point
you should never assume that the Backpack's parent is always a Player
define the player outside the loop
so then the player should be gmae:getservice "players"?