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

Roblox Error? Making a StarterCharacter Shop?

Asked by 3 years ago

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

Log in to vote
0
Answered by
raid6n 2196 Moderation Voter Community Moderator
3 years ago

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)

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 DataCordz 6 — 3y
0
add a character to the skin (humanoid) raid6n 2196 — 3y
0
raid6n do u want me to add another humanoid to my skin? Im confused im a new scripter lol but ok DataCordz 6 — 3y
Ad

Answer this question