PointScript
script.Parent.ClickDetector.MouseClick:Connect(function(Player)
local leaderstats = Player:WaitForChild("leaderstats")
local Points = leaderstats:WaitForChild("Points")
local Multiplier = Player:WaitForChild("Multiplier")
if Multiplier.Value > 0 then
Points.Value += 1* Multiplier.Value
else
Points.Value += 1
end
end)
ServerScriptService==>RebirthServer
local RebirthEvent = game.ReplicatedStorage:WaitForChild("RebirthEvent")
game.Players.PlayerAdded:Connect(function(Player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = Player
local Points = Instance.new("IntValue")
Points.Name = "Points"
Points.Value = 0
Points.Parent = leaderstats
local Rebirth = Instance.new("IntValue")
Rebirth.Name = "Rebirth"
Rebirth.Value = 0
Rebirth.Parent = leaderstats
local Multiplier = Instance.new("IntValue")
Multiplier.Name = "Multiplier"
Multiplier.Value = 0
Multiplier.Parent = Player
end)
RebirthEvent.OnServerEvent:Connect(function(Player)
local leaderstats = Player:WaitForChild("leaderstats")
local Multiplier = Player:WaitForChild("Multiplier")
leaderstats.Points.Value = 0
leaderstats.Rebirth.Value += 1
Multiplier.Value += 2
end)
StarterGui==>RebirthGui==>RebirthClient
local Player = game.Players.LocalPlayer
local leaderstats = Player:WaitForChild("leaderstats")
local Multiplier = Player:WaitForChild("Multiplier")
local Toggle = script.Parent:WaitForChild("Toggle")
local Frame = script.Parent:WaitForChild("Frame")
local RebirthEvent = game.ReplicatedStorage:WaitForChild("RebirthEvent")
local RequiredPoints = 10
Toggle.MouseButton1Click:Connect(function()
Frame.Visible = not Frame.Visible
Frame.Price.Text = "Price: "..RequiredPoints.." Points"
Frame.Multi.Text = "New Multiplier: x"..Multiplier.Value + 2
end)
Frame.Confirm.MouseButton1Click:Connect(function()
if leaderstats.Points.Value >= RequiredPoints then
RequiredPoints *= 2
Frame.Visible = false
RebirthEvent:FireServer()
end
end)