Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Roblox Error? Making a StarterCharacter Shop?

So im trying to make a fortnite item shop were u can buy skins well startercharacters but i did the script correctly i think. I keep getting this error - "LoadAnimation requires the Humanoid object (DataCordz.Humanoid) to be a descendant of the game object"

the script i use for the skin/startercharacter gamepasses

'local GamepassId = 10797682

local MarketplaceService = game:GetService("MarketplaceService") local GamepassStarterCharacter = game.ReplicatedStorage.RedSkin

local Gamepassfunction = function(plr) local Character = plr.Character or ("GamepassSkins") if MarketplaceService:UserOwnsGamePassAsync(plr.UserId,GamepassId) then plr:LoadCharacter(GamepassStarterCharacter) else print("Doesn't Own") end end

game.Players.PlayerAdded:Connect(function(plr) local error,succ = pcall(function() Gamepassfunction(plr) end)

if error then print("Unsuccessful") elseif not error then print("Did") end end)'


1 answer

Your code: (with notes)

local GamepassId = 10797682

local MarketplaceService = game:GetService("MarketplaceService")
local GamepassStarterCharacter = game.ReplicatedStorage.RedSkin

local Gamepassfunction = function(plr)
    local Character = plr.Character or ("GamepassSkins")
    if MarketplaceService:UserOwnsGamePassAsync(plr.UserId, GamepassId) then
        plr:LoadCharacter(GamepassStarterCharacter)
    else
        print("Doesn't Own")
    end
end

game.Players.PlayerAdded:Connect(
    function(plr)
        local error, succ =
            pcall(
            function()
                Gamepassfunction(plr)
            end
        )

        if error then
            print("Unsuccessful")
        elseif not error then
            print("Did")
        end
    end
)

Output: LoadAnimation requires the Humanoid object (DataCordz.Humanoid) to be a descendant of the game object

why it doesn't work: LoadAnimation requires the Humanoid

do on line 9 do plr:LoadCharacter(GamepassStarterCharacter.Humanoid)

3 comments

0

i did that and it gave me the same error and DataCordz is my name btw and i found another error too "Player:Move called, but player currently has no humanoid" even though my startercharacter does have a humanoid

0

add a character to the skin (humanoid)

0

raid6n do u want me to add another humanoid to my skin? Im confused im a new scripter lol but ok

This discussion is preserved as it was. New answers, comments, and votes are closed.