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?
✓ ANSWER ACCEPTED
How do i make a point giver without cooldown affecting other players?
1 answer
✓ Accepted answer
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
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
not working for me