local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")
local RPG Engine = ServerScriptService:WaitForChild("RPG Engine")
local RemoteEvent = Instance.new("Folder", ReplicatedStorage)
RemoteEvent.Name = "CharacterCreationRemote"
local HairChangerRightEvent = Instance.new("RemoteEvent", RemoteEvent)
HairChangerRightEvent.Name = "HairChangerRight"
local HairChangerLeftEvent = Instance.new("RemoteEvent", RemoteEvent)
HairChangerLeftEvent.Name = "HairChangerLeft"
-- Functions --
local function HairChangerRight(player)
(player.Name).Cosmetics.HairStyle.Value = (player.Name).Cosmetics.HairStyle.Value + 1
if (player.Name).Cosmetics.HairStyle.Value > 10 then
(player.Name).Cosmetics.HairStyle.Value = 0
end
end
local function HairChangerLeft(player)
(player.Name).Cosmetics.HairStyle.Value = (player.Name).Cosmetics.HairStyle.Value + 1
if (player.Name).Cosmetics.HairStyle.Value > 0 then
(player.Name).Cosmetics.HairStyle.Value = 10
end
end
-- Function Callings --
HairChangerRightEvent.OnServerEvent:Connect(HairChangerRight)
HairChangerLeftEvent.OnServerEvent:Connect(HairChangerLeft)
The Folder is in ServerStorage holding a folder with the player name and 6 subfolders containing values. So Comestics is a subfolder.

2 comments
It fires with the player it just says Attempt to index field 'Cosmetics' (a nil value)
Oh, it seems your code is directly trying to find “Cosmetics” IN the player. Make sure you specify where the player and cosmetics are. Like “game.Workspace(player.Name).Cosmetics”.