a part that is a point giver and it has a cooldown but that don't affect any other players Sorry for asking basic questions but I'm a beginner. And i don't have any code written by me so can you write for me please?
server script in ServerScriptService
game.Players.PlayerAdded:Connect(function(plr) local leaderstats = Instance.new("Folder") leaderstats.Name = "Leaderstats" leaderstats.Parent = plr local points = Instance.new("IntValue") points.Name = "points" points.Parent = leaderstats end)
now add a local script inside the part and a remote event inside of ReplicatedStorage
while wait(2) do game:GetService("ReplicatedStorage").RemoteEvent:FireServer()
and finally add another serverscript in serverscriptservice
game:GetService("ReplicatedStorage").RemoteEvent.OnServerEvent:Connect(function(plr) plr.Leaderstats.points.Value += 1