Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local Players = game:GetService("Players")
- local Remotes = ReplicatedStorage.Remotes
- local function PlayerAdded(Player: Player)
- local Leaderstats = Player:WaitForChild("leaderstats")
- local LevelValue = Leaderstats:WaitForChild("Level")
- local RebirthValue = Leaderstats:WaitForChild("Rebirth")
- local XPValue = Player:WaitForChild("XP")
- local RequiredLevel = (RebirthValue.Value * 25) + 25
- RebirthValue.Changed:Connect(function()
- RequiredLevel = (RebirthValue.Value * 25) + 25
- end)
- if LevelValue.Value >= RequiredLevel then
- Remotes.CanRebirth:FireClient(Player)
- end
- LevelValue.Changed:Connect(function()
- if LevelValue.Value >= RequiredLevel then
- Remotes.CanRebirth:FireClient(Player)
- end
- end)
- Remotes.Rebirth.OnServerEvent:Connect(function()
- if LevelValue.Value >= RequiredLevel then
- RebirthValue.Value += 1
- LevelValue.Value = 1
- XPValue.Value = 0
- end
- end)
- end
- Players.PlayerAdded:Connect(PlayerAdded)
Advertisement
Add Comment
Please, Sign In to add comment