Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local uis = game:GetService("UserInputService")
- local robbing = false
- local clicks = 25
- local clicked = 0
- uis.InputBegan:Connect(function(key, event)
- if key.KeyCode == Enum.KeyCode.E and not event then
- if (game.Players.LocalPlayer.Character.PrimaryPart.Position - script.Parent.Parent.Adornee.Position) .magnitude < 6 then
- robbing = true
- if clicked < clicks then
- script.Parent.Parent.Text.Text = "Robbing..."
- script.Parent.Visible = true
- clicked = clicked + 1
- script.Parent.Robber:TweenSize(UDim2.new((clicked/clicks), 0, 1, 0), "Out", "Quad", 0.3, true)
- script.Parent.BackgroundColor3 = Color3.fromRGB(0, 255, 115)
- script.Parent.Robber.TextLabel.TextColor3 = Color3.fromRGB(0, 170, 73)
- if clicked == clicks and game.Workspace.RobPart.Open.Value == true then
- wait(0.3)
- script.Parent.Parent.Text.Text = "Robbery Success!"
- local amount = math.random(500, 5000)
- script.Parent.Robber.TextLabel.Text = "+ $"..amount.."!"
- robbing = false
- game.ReplicatedStorage.RobStatus:FireServer(amount)
- elseif clicked == clicks and game.Workspace.RobPart.Open.Value == false then
- wait(0.3)
- script.Parent.Parent.Text.Text = "Robbery Failed!"
- script.Parent.Robber.BackgroundColor3 = Color3.fromRGB(197, 55, 55)
- script.Parent.Robber.TextLabel.TextColor3 = Color3.fromRGB(149, 41, 41)
- script.Parent.Robber.TextLabel.Text = "We have no money..."
- robbing = false
- end
- end
- end
- end
- end)
- wait(3)
- while true do
- if (game.Players.LocalPlayer.Character.PrimaryPart.Position - script.Parent.Parent.Adornee.Position) .magnitude < 6 then
- script.Parent.Parent.Enabled = true
- else
- robbing = false
- script.Parent.Visible = true
- script.Parent.Parent.Text.Text = "Press E to Rob!"
- script.Parent.Robber.TextLabel.Text = ""
- clicked = 0
- script.Parent.Robber.Size = UDim2.new(0,0,1,0)
- script.Parent.Parent.Enabled = false
- end
- wait(0.3)
- end
Advertisement
Add Comment
Please, Sign In to add comment