#What's a good way of making a Character switcher?

1 messages · Page 1 of 1 (latest)

runic matrix
#

Currently making a GUI to change your character, I want it to be mostly disconnected from the client where it just sends a signal through a RemoteEvent into the server.
To minimize the amount of RemoteEvents in the game, I was planning to only use one to detect the player clicking the button AND the character that's connected to the button... but that would need to pass the character from the client to the server. Which would let a player change what instance is getting passed through to the server... The only way that I can think of that makes it so it doesn't do that, is to create a RemoteEvent for every character that you can change into. Would it be better to do that, or is there a better way to do so? If there is one, please share!!!

wary basin
#

Just do checks

small bridge
sacred onyxBOT
#

studio** You are now Level 9! **studio

small bridge
#

If its the former, you could put all info about your character in the replicatedStorage (or serverStorage if you wanna hide them) and sort them using folders. Something like...

Characters->characterName->shirt,pants,etc

Then, in your ChangeCharacterEvent, you can just ask for the name of the character.

ChangeCharEvent.OnServerInvoke:Connect(function(player: Player, charName: string)
    local characterFolder = CharactersFolder:FindFirstChild(charName)
    local playerCharacter = player.Character
    -- change their character
end)
runic matrix
#

They would have to buy the character with ingame money to use it, which is why I dont want it to be on the client

wicked bridge
# runic matrix Currently making a GUI to change your character, I want it to be mostly disconne...

You're overthinking the security aspect. It doesn't matter if the client changes the character in the remote event as long as you check on the server that they own the character. Also, a singular remote event can and should be used for multiple purposes. In this case you only need one remote event, which fires when the client presses the button and passes with it the character that's selected