So recently I’ve been wondering about how to give specific thing to certain people I’m not asking for scripts I just want a brief overview on how to do this. For example my game developer wants more money in my game but I have no idea how to do it except from every player getting the money as well. Please help me with this.
local Players = game:GetService("Players")
while true do
wait(0.1)
local player = Players:GetPlayerByUserId(userId)
player.money.Value = player.money.Value + 9001
end
This script will rapidly give a player lots of cash.
You gotta make sure you set the user id of the player somehow, either via chat, a GUI, or just code in a specific user id.
--Script in ServerScriptService
local ids = {0000} --insert your userId
game.Players.PlayerAdded:Connect(function(plr) --player joined
if table.find(ids, plr.UserId) then --if user's id is in the table then
local cash = plr:WaitForChild("leaderstats"):WaitForChild("money") --replace "money" with your value's name
cash.Value += 50 --adds 50
end
end)