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

I got a HUGE problem im trying to make a StarterCharacter Gamepass?

Asked by 3 years ago
Edited 3 years ago

Im trying to make a StarterCharacter gamepass. When they buy the gamepass they get a in game skin. The script works its just when ever i spawn im invis and i cant move.

The script i used

local GamepassId = (10797682)

local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")
local ServerStorage = game:GetService("ServerStorage")
local GamepassStarterCharacter = ServerStorage.StarterCharacter

local GamepassFunction = function(Player)
    if not Player:IsA("Player") then
        return
    end
    Player.CharacterAdded:Connect(function(Character)
        local function LoadCharacter(Path)
            for i,v in pairs(Character:GetChildren()) do
                v:Destroy()
            end
            for i,v in pairs(Character:GetChildren()) do
                v:Clone().Parent = Character
            end
            if not Character:FindFirstChildOfClass("Humanoid") then
                Instance.new("Humanoid",Character)
            end
        end
        if MarketplaceService:UserOwnsGamePassAsync(Player.UserId,GamepassId) then
            LoadCharacter(GamepassStarterCharacter)
        else
            LoadCharacter(ServerStorage.RedSkin)
        end
    end)
end

for i,v in pairs(Players:GetPlayers()) do
    GamepassFunction(v)
end
Players.PlayerAdded:Connect(GamepassFunction)
0
Could you put the code in a code block? Edit the question, select the code and click the blue "Lua" icon. For more information, click this and scroll to the bottom: https://scriptinghelpers.org/help/how-post-good-questions-answers gskw 1046 — 3y
0
I added it for you Leamir 3138 — 3y
0
i edited it did i do it correectly? DataCordz 6 — 3y
0
its anchored, weld and your destroying all of it, put destroy the old character then insert new costume because your putting it then destroying. moeck2 7 — 3y
0
its not anchored i checked all the parts and the humaniod plus the humaniod root part DataCordz 6 — 3y

1 answer

Log in to vote
0
Answered by
uhi_o 417 Moderation Voter
3 years ago
Edited 3 years ago

Your just destroying the character and adding a humanoid in the empty character model??

How about try this

local GamepassId = 10797682

local MarketplaceService = game:GetService("MarketplaceService")
local GamepassStarterCharacter = game.ServerStorage.StarterCharacter

local GamepassFunction = function(Player)
    Player.CharacterAdded:Connect(function(Character)
        local function LoadCharacter(Path)
      --[[ in case you want starter scripts
            for _, v in pairs(Character:GetChildren()) do
                if v.ClassName ~= "Script" or v.ClassName ~= "LocalScript" then
                    v:Destroy()
                end
            end
            ]]
            Character:Destroy()
            Path.Parent = workspace
            Character = Path
        end
        if --[[not]] MarketplaceService:UserOwnsGamePassAsync(Player.UserId,GamepassId) then --Idk I think you meant to check if they don't own it
            LoadCharacter(GamepassStarterCharacter)
        else
            LoadCharacter(game.ServerStorage.RedSkin)
        end
    end)
end

game.Players.PlayerAdded:Connect(GamepassFunction)

I'm deleting the starter character then inserting your model instead for the character. I'm not sure if this works but I seen somebody do it before.

Also, if this did not work then just recolor the character and stuff.

0
no i actually have a model already made in server storage but the thing is im invis whenever i spawn. So if a player bought the gamepass they would spawn invis and not able to walk DataCordz 6 — 3y
0
heres my discord ima show you pictures of whats happening Data Cords#7176 DataCordz 6 — 3y
0
I just wrote up a script for you to test bruh. Did you tyr it? Did the same issue reproduce? uhi_o 417 — 3y
0
Yeah DataCordz 6 — 3y
View all comments (4 more)
0
i tired your script and it worked but im stil invis and i still cant walk DataCordz 6 — 3y
0
i also keep getting this error - LoadAnimation requires the Humanoid object (DataCordz.Humanoid) to be a descendant of the game object DataCordz 6 — 3y
0
That's your script error. You're supposed to clone the character object in workspace. Also edited the script. uhi_o 417 — 3y
0
Sorry im new to scripting so im pretty sure its like this? Clone().Parent = Character or something like that because if i put that into the script it still doesn't work DataCordz 6 — 3y
Ad

Answer this question