local DataStoreService = game:GetService("DataStoreService")
local ds = DataStoreService:GetDataStore("money")
local paycheck = Instance.new("RemoteEvent")
paycheck.Parent = game.ReplicatedStorage
paycheck.Name = "paycheck"
game.Players.PlayerAdded:Connect(function(player)
local a = true
while a do
if player.Team.Name == "Citizen" then
wait(10)
local value = player.leaderstat.Money.Value
value = value+50
player.leaderstat.Money.Value = value
increment = 50
paycheck:FireClient(player,increment)
elseif player.Team.Name == "Police" then
wait(10)
local value = player.leaderstat.Money.Value
value = value+70
player.leaderstat.Money.Value = value
increment = 70
paycheck:FireClient(player,increment)
end
end
end)
I have this. However, if I change my team to Police, roblox does not register the fact I've changed teams and so still gives me the 50, despite being on the police team, so I should be getting 70. Any help would be much appreciated.

1 comment
It's a server script