I'm trying to make a chair simulator game where you are a chair, and if you buy a gamepass, it will turn only you into a table. I'm finding some trouble getting the chair turned into a table. I have put a folder with the StarterCharacter of the table in ReplicatedStorage, and I put a script in ServerScriptService that has the following line of code in it:
local starterplayer = game.StarterPlayer
local Avatar = game:GetService("ReplicatedStorage"):FindFirstChild("Table").StarterCharacter
game.Players.PlayerAdded:Connect(function(player)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 20094414) then
local PlayerAvatar = Avatar:Clone()
game:GetService("StarterPlayer").StarterCharacter:Destroy()
PlayerAvatar.Name = "StarterCharacter"
PlayerAvatar.Parent = game:GetService("StarterPlayer")
wait(0.1)
player:LoadCharacter()
end
end)
I would note also that the GUI button that gives you the gamepass is fine, it's this script is the problem. If I'm wrong, please tell me. Also, there is already a StarterCharacter model in StarterPlayer. This is why I have it destroyed when you get the gamepass, so that you aren't a chair, you are a table. I would extremely appreciate it if this was solved. Thank you!

2 comments
You can't set the starter character differently for different players. Instead, clone the table, set the player's character to the clone (player.Character = table) and set the table's parent to the workspace. Make sure to do this whenever the player spawns.
There might be a few other things you'll need to do manually, which are otherwise done by :LoadCharacter(), such as cloning character scripts.