Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make a point giver without cooldown affecting other players?

Asked by 1 year ago

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?

1 answer

Log in to vote
0
Answered by 1 year ago

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
0
not working for me Megati_PL 2 — 1y
Ad

Answer this question