RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"give the player 5 coins when their stage value 1"
-- server script local Players = game:GetService("Players") local function onPlayerAdded(player) local leaderstats = Instance.new("IntValue") leaderstats.Name = "leaderstats" leaderstats.Parent = player local stage = Instance.new("IntValue") stage.Name = "Stage" stage.Value = 0 stage.Parent = leaderstats local coins = Instance.new("IntValue") coins.Name = "Coins" coins.Value = 0 coins.Parent = leaderstats stage:GetPropertyChangedSignal("Value"):Connect(function() if stage.Value == 1 then coins.Value = coins.Value + 5 end end) end Players.PlayerAdded:Connect(onPlayerAdded)