Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TService = game:GetService("TweenService")
- local RStorage = game:GetService("ReplicatedStorage")
- local SService = game:GetService("SoundService")
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local Remotes = RStorage.Remotes
- local Modules = RStorage.Modules
- local UI = script.Parent
- local RebirthMenu = UI.RebirthMenu
- local CodeMenu = UI.CodeMenu
- local Bottom = UI.Bottom
- local Click = Bottom.Click
- local Rebirth = Bottom.Rebirth
- local StatFrame = UI.Stats
- local Clicks = StatFrame.Clicks
- local Rebirths = StatFrame.Rebirths
- local ClickLabel = Clicks.Label
- local RebirthLabel = Rebirths.Label
- function newInfo(Time)
- return TweenInfo.new(Time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
- end
- function Notify(Text, Color)
- local Template = script.Template:Clone()
- Template.Parent = UI
- Template.Position = UDim2.new(math.random(2, 8) / 10, 0, math.random(3, 6) / 10, 0)
- Template.TextColor3 = Color or Template.TextColor3
- Template.Text = Text
- local Tween = TService:Create(Template, TweenInfo.new(1), {
- TextTransparency = 1,
- Position = Template.Position + UDim2.new(0, 0, -0.1, 0)
- })
- Tween:Play()
- local Connection
- Connection = Tween.Completed:Connect(function()
- Connection:Disconnect()
- Template:Destroy()
- end)
- end
- function Play(sfx)
- local new = sfx:Clone()
- new.Parent = SService
- new:Destroy()
- end
- function ApplyButton(obj, callback)
- local isHovering = false
- local oldSize = obj.Size
- local oldColor = obj.BackgroundColor3
- local INF, INF2 = newInfo(0.3), newInfo(0.2)
- local MB1D_TWEEN = TService:Create(obj, INF2, {
- Size = UDim2.new(oldSize.X.Scale * 0.85, 0, oldSize.Y.Scale * 0.85, 0),
- BackgroundColor3 = Color3.new(oldColor.R * 0.8, oldColor.G * 0.8, oldColor.B * 0.8)
- })
- local HOVER = TService:Create(obj, INF, {
- Size = UDim2.new(oldSize.X.Scale * 1.1, 0, oldSize.Y.Scale * 1.1, 0),
- BackgroundColor3 = Color3.new(oldColor.R * 0.9, oldColor.G * 0.9, oldColor.B * 0.9)
- })
- local RESET = TService:Create(obj, INF, {
- Size = oldSize,
- BackgroundColor3 = oldColor
- })
- obj.MouseButton1Down:Connect(function()
- MB1D_TWEEN:Play()
- Play(script.click)
- callback()
- end)
- obj.MouseButton1Up:Connect(function()
- if isHovering then
- HOVER:Play()
- else
- RESET:Play()
- end
- Play(script.unclick)
- end)
- obj.MouseEnter:Connect(function()
- HOVER:Play()
- isHovering = true
- Play(script.hover)
- end)
- obj.MouseLeave:Connect(function()
- RESET:Play()
- isHovering = false
- Play(script.unhover)
- end)
- end
- local RebirthsValue = LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Rebirths")
- local ClicksValue = LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Clicks")
- RebirthLabel.Text = RebirthsValue.Value
- RebirthsValue.Changed:Connect(function()
- RebirthLabel.Text = RebirthsValue.Value
- end)
- ClickLabel.Text = ClicksValue.Value
- ClicksValue.Changed:Connect(function()
- ClickLabel.Text = ClicksValue.Value
- RebirthMenu.Requirements.Label.Text = ("%d Clicks"):format((RebirthsValue.Value + 1) * 100)
- end)
- ApplyButton(Click, function()
- Remotes.Click:FireServer()
- Notify(("+%d Clicks"):format(RebirthsValue.Value + 1))
- end)
- ApplyButton(Rebirth, function()
- RebirthMenu.Visible = not RebirthMenu.Visible
- end)
- ApplyButton(RebirthMenu.Close, function()
- RebirthMenu.Visible = false
- end)
- ApplyButton(RebirthMenu.Confirm, function()
- if ClicksValue.Value >= (RebirthsValue.Value + 1) * 100 then
- Remotes.Rebirth:FireServer()
- Notify("+1 Rebirths", Color3.fromRGB(255, 129, 211))
- Play(script.rebirth)
- else
- Notify("NEED MORE CLICKS", Color3.fromRGB(255, 0, 0))
- Play(script.error)
- end
- end)
- ApplyButton(StatFrame.Codes, function()
- CodeMenu.Visible = not CodeMenu.Visible
- end)
- ApplyButton(CodeMenu.Close, function()
- CodeMenu.Visible = false
- end)
- local Codes = require(Modules.Codes)
- ApplyButton(CodeMenu.Confirm, function()
- local TypedCode = CodeMenu.CodeBox.Text
- local Found = false
- for code, callback in Codes do
- if code == TypedCode:lower() then
- Found = true
- break
- end
- end
- if Found then
- local Result = Remotes.Code:InvokeServer(TypedCode)
- if Result == 0 then
- Notify("INVALID CODE", Color3.fromRGB(255, 0, 0))
- Play(script.error)
- elseif Result == 1 then
- Notify("ALREADY USED CODE", Color3.fromRGB(255, 0, 0))
- Play(script.error)
- elseif Result == 2 then
- Notify("CODE SUCCESS", Color3.fromRGB(0, 255, 0))
- Play(script.code)
- end
- else
- Play(script.error)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement