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.
Do your RemoteEvents fire with the player? If not, then your functions will think player is nil, causing an error to happen.
To fix this, simply do this to whatever is firing the events :
RemoteEvent:FireServer(Player) - - If firing FROM a localscript RemoteEvent:FireClient(Player) - - If firing FROM a script
Also make sure you specify what the player is exactly. Simply putting “Player” isn’t going to work. :P