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

Does anyone know how to make it so when a player buys a gamepass they get a "Skin/StarterCharacter)?

Asked by 3 years ago

I have been doing this for weeks now and i haven't found a answer. Im basically trying to make a fortnite item shop were you can get "Characters" to wear when you buy it, in this case a gamepass. The "StarterCharacter" im trying to make as a skin in the shop is called "RedSkin" but i the script i use does nothing. I also have "default character/StarterCharacter" but i dont think that could be affecting the script because its in starterplay and the script should replace thats users default into the Redskin

current script i use

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.Humanoid)
  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("Nope, No Luck")
  elseif not error then
    print("Did")
  end
end)

new to scripting btw

0
What's the output? raid6n 2196 — 3y
0
What's the output? raid6n 2196 — 3y
0
I'm a newbie at Custom Character, but at line 9 do: `GamepassStarterCharacter.Parent = game.StarterPlayer' raid6n 2196 — 3y
0
and at the next line add 'plr:LoadCharacter(plr.Character.Humanoid) raid6n 2196 — 3y
View all comments (3 more)
0
aight ill try DataCordz 6 — 3y
0
output window? then its print() DataCordz 6 — 3y
0
It said it did work but then this error happend - Player:Move called, but player currently has no humanoid. DataCordz 6 — 3y

Answer this question