hello! i'm working on a game in which you can switch between different characters. my game does this by cloning different startercharacters (stored in starterpack) into the starterplayer and switching out the character currently being used.
This works just fine!! there's just one problem.
Say I have a base character (a colorless, featureless character) that everyone spawns in as before choosing which character to play as. If I choose, for example, to play as a cat, I respawn as a cat. The problem is.... everyone else who resets or joins the game from that point on will no longer spawn in as the base character, but rather the cat.
I'm using a remote event for the buttons that trigger switching to another starter character.
Here is my local script:
function Click() game.ReplicatedStorage.RemoteEvent:FireServer() end script.Parent.MouseButton1Down:connect(Click)
and my server script:
local Beta = game.StarterPack.Beta local BetaClone = Beta:Clone() game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player) game.StarterPlayer.StarterCharacter.Name= "NotInUse" BetaClone.Parent = game.StarterPlayer BetaClone.Name = "StarterCharacter" player:LoadCharacter() end)
(note: Beta is the name of one of my characters in the game.)
I realize the problem is that the remote event is causing everyone's startercharacter to change, not just one person's. But I'm not sure how to fix it. Does anyone know how to fix it to where only the local player's startercharacter will change, and not everyone else's? Or if there are better ways to make this work? I dont even know if remoteevents are required for this.
i'm a little new at remoteevents, so i probably sound kinda inexperienced, but can someone help? thank you!!
use a localscript; and if you cant, just make a characteradded event and clone the localscript into that