while true do
wait(15)
for i,v in pairs(game.Players:GetPlayers()) do
local hum = v.Character:WaitForChild("Humanoid")
if v:FindFirstChild("Leaderstats") then
if v.Team == game.Teams.Playing then
v.Leaderstats.Coins = v.Leaderstats.Coins + amount
v.WinSound:Play()
wait(2)
v.Team = game.Teams.Lobby
hum.Health = 0
end
end
end
end
COMMUNITY QUESTION
My script d'ont want to give a Team some points ??
1 answer
General Practice
Use :GetService() to retrieve the Players and Team Services
Use :WaitForChild() to make sure something exists before using or changing it
Issues
When you want to change the "Coins" value under "Leaderstats" you have to specify the property Value so that it will change, otherwise you are attempting to alter the Coins IntValue directly, not its property.
Revised Server Script
local amount = 25 -- amount you are giving to the player
while true do
wait(15)
for i, v in pairs(game:GetService("Players"):GetPlayers()) do
local hum = v.Character:WaitForChild("Humanoid")
if v:FindFirstChild("Leaderstats") then
if v.Team == game:GetService("Teams"):WaitForChild("Playing") then
local coins = v:WaitForChild("Leaderstats"):WaitForChild("Coins")
coins.Value = coins.Value + amount
v:WaitForChild("WinSound"):Play()
wait(2)
v.Team = game:GetService("Teams"):WaitForChild("Lobby")
hum.Health = 0
end
end
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
explain more idioit
what script did you use Server Script or local?
ServerScript
Nothing appear on the output when it was suppose to say it