So when a player joins it should create a new folder and values inside that folder. But when i create a new server it doesn't do that why? Server Script
local removeEvent = game.ReplicatedStorage.PlayerTo
game.Players.PlayerAdded:Connect(function(player)
removeEvent:FireClient(player)
end)
** Local Script **
local replicatedStorage = game:GetService("ReplicatedStorage")
local event = replicatedStorage:WaitForChild("PlayerTo")
event.OnClientEvent:Connect(function()
local NewFolder = Instance.new("Folder")
NewFolder.Parent = game.Workspace.Stat
NewFolder.Name = game.Players.LocalPlayer.Name
local PointValue = Instance.new("NumberValue")
PointValue.Value = 0
PointValue.Name = "Points"
PointValue.Parent = NewFolder
local AssistValue = Instance.new("NumberValue")
AssistValue.Value = 0
AssistValue.Name = "Assists"
AssistValue.Parent = NewFolder
end)

4 comments
Put all the folder making stuff in the server script and then just remove the local. Adding a folder to the player cannot be done and shown to the whole server if you are using a local script I think.
This also means you don't need a event
tysm
please accept my answer :)