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!
The player has an object value inside of it called "Character" which you could change without having to respawn the player, you would just have to add a character added event and change the player's character through there..