Here is better explanation
I am making equip uniform (shirt + pants) system, where when you click on a button, you get uniform and when you die/reset (not fricking leave, so databases are not neccessary), uniform you wore stays, until you leave/change them (if change, temporary value changes)
Script:
local ReplicatedStorage = game.ReplicatedStorage
local RemoteEvent = ReplicatedStorage.GiveShirt
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAppearanceLoaded:Connect(function(character)
local Temporary1 = character:FindFirstChild("shirtsaver")
local Temporary2 = character:FindFirstChild("pantsaver")
RemoteEvent.OnServerEvent:Connect(function(player, shirtTemplate, pantsTemplate)
if shirtTemplate == "607785314" and pantsTemplate == "129458426" then
character.Shirt.ShirtTemplate = game:GetService("InsertService"):LoadAsset(shirtTemplate).Shirt.ShirtTemplate
character.Pants.PantsTemplate = game:GetService("InsertService"):LoadAsset(pantsTemplate).Pants.PantsTemplate
Temporary1.Value = 607785314
Temporary2.Value = 129458426
end
end)
character.Shirt.ShirtTemplate = game:GetService("InsertService"):LoadAsset(Temporary1.Value).Shirt.ShirtTemplate
character.Pants.PantsTemplate = game:GetService("InsertService"):LoadAsset(Temporary2.Value).Pants.PantsTemplate
end)
end)

1 comment
When I'm doing storage of things that I want to keep consistent throughout the game experience, I often have a value in server storage (or replicated storage if I need it) that I just modify..