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