RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a little rpg system that updates when a humanoid is killed"
-- server script local Players = game:GetService("Players") local function onCharacterAdded(character) local humanoid = character:WaitForChild("Humanoid") humanoid.Died:Connect(function() local player = Players:GetPlayerFromCharacter(character) if player then player.leaderstats.Level.Value = player.leaderstats.Level.Value + 1 player.leaderstats.Exp.Value = player.leaderstats.Exp.Value + 50 print(player.Name .. " has leveled up to " .. player.leaderstats.Level.Value .. " and gained 50 EXP!") end end) end local function onPlayerAdded(player) player.CharacterAdded:Connect(onCharacterAdded) end Players.PlayerAdded:Connect(onPlayerAdded)