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

character is not a vailid memeber of workspace??

Asked by 5 years ago
Edited 5 years ago

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")
0
if character.Parent == game.Workspace then DeceptiveCaster 3761 — 5y
0
doesnt work' SplendidKyle567 8 — 5y
0
Don't wait for character on a loop. Wait for it using the CharacterAdded event. SummerEquinox 643 — 5y
0
Player.CharacterAdded:Wait() ^ SummerEquinox 643 — 5y
View all comments (6 more)
0
have you defined the player? like OnceLegend 3 — 5y
0
have you defined the player? like local.Humanoid = player or something? OnceLegend 3 — 5y
0
@OnceLegend has a point DeceptiveCaster 3761 — 5y
0
you should never assume that the Backpack's parent is always a Player DeceptiveCaster 3761 — 5y
0
define the player outside the loop DeceptiveCaster 3761 — 5y
0
so then the player should be gmae:getservice "players"? SplendidKyle567 8 — 5y

Answer this question