RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a little rpg system that updates when a humanoid is killed use gold exp and leveling"
-- server script local Players = game:GetService("Players") function onCharacterAdded(character) local humanoid = character:WaitForChild("Humanoid") humanoid.Died:Connect(function() local playerStats = Players:GetPlayerFromCharacter(character).leaderstats playerStats.Exp.Value = playerStats.Exp.Value + 50 playerStats.Gold.Value = playerStats.Gold.Value + 100 if playerStats.Exp.Value >= 100 then playerStats.Exp.Value = 0 playerStats.Level.Value = playerStats.Level.Value + 1 end end) end Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(onCharacterAdded) if player.Character then onCharacterAdded(player.Character) end end)