ADVERTISEMENTREMOVE ADS
Game icon

milk v2

Milky [Beta]
2 months ago
Script preview thumbnail
Script Preview

Description

This time it tps so its more useful for any part of the game it tps to the milk, cheese, big milk, and upgrades (also i dont know if there is more milks i would have to put in if there is please comment and tell me)

ADVERTISEMENTREMOVE ADS
133 Lines • 3.89 KiB
Raw
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local LocalPlayer = Players.LocalPlayer
pcall(function()
game.CoreGui:FindFirstChild("funny gui"):Destroy()
end)
local gui = Instance.new("ScreenGui", game.CoreGui)
gui.Name = "funny gui"
gui.ResetOnSpawn = false
local mainFrame = Instance.new("Frame")
mainFrame.Size = UDim2.new(0, 160, 0, 80)
mainFrame.Position = UDim2.new(0, 20, 0, 20)
mainFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
mainFrame.BorderSizePixel = 0
mainFrame.Active = true
mainFrame.Draggable = false
mainFrame.Parent = gui
local titleBar = Instance.new("Frame")
titleBar.Size = UDim2.new(1, 0, 0, 30)
titleBar.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
titleBar.BorderSizePixel = 0
titleBar.Name = "TitleBar"
titleBar.Parent = mainFrame
local titleLabel = Instance.new("TextLabel")
titleLabel.Size = UDim2.new(1, 0, 1, 0)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = "FUNNY GUI"
titleLabel.TextColor3 = Color3.new(1, 1, 1)
titleLabel.Font = Enum.Font.SourceSansBold
titleLabel.TextSize = 18
titleLabel.Parent = titleBar
local toggleButton = Instance.new("TextButton")
toggleButton.Size = UDim2.new(1, -20, 0, 30)
toggleButton.Position = UDim2.new(0, 10, 0, 40)
toggleButton.Text = "Start"
toggleButton.BackgroundColor3 = Color3.fromRGB(0, 170, 0)
toggleButton.TextColor3 = Color3.new(1, 1, 1)
toggleButton.Font = Enum.Font.SourceSansBold
toggleButton.TextSize = 20
toggleButton.Parent = mainFrame
local dragging = false
local dragInput, dragStart, startPos
titleBar.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
dragStart = input.Position
startPos = mainFrame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
titleBar.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
UserInputService.InputChanged:Connect(function(input)
if input == dragInput and dragging then
local delta = input.Position - dragStart
mainFrame.Position = UDim2.new(
startPos.X.Scale, startPos.X.Offset + delta.X,
startPos.Y.Scale, startPos.Y.Offset + delta.Y
)
end
end)
local moving = false
local currentThread = nil
local function getTargetParts()
local parts = {}
for _, obj in pairs(workspace:GetDescendants()) do
if obj:IsA("BasePart") or obj:IsA("Highlight") then
local name = obj.Name:lower()
if name == "milk" or name == "cheese" or name == "bigmilk" or name == "highlight" then
table.insert(parts, obj)
end
end
end
return parts
end
local function tpToPart(part)
if LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
if part:IsA("BasePart") then
LocalPlayer.Character:PivotTo(CFrame.new(part.Position))
elseif part:IsA("Highlight") and part.Adornee and part.Adornee:IsA("BasePart") then
LocalPlayer.Character:PivotTo(CFrame.new(part.Adornee.Position))
end
end
end
local function startMovement()
if currentThread then return end
currentThread = task.spawn(function()
while moving do
local parts = getTargetParts()
for _, part in ipairs(parts) do
if not moving then break end
tpToPart(part)
task.wait(0.05)
end
task.wait(0.1)
end
currentThread = nil
end)
end
local function toggleMovement()
moving = not moving
toggleButton.Text = moving and "Stop" or "Start"
toggleButton.BackgroundColor3 = moving and Color3.fromRGB(170, 0, 0) or Color3.fromRGB(0, 170, 0)
if moving then
startMovement()
else
currentThread = nil
end
end
toggleButton.MouseButton1Click:Connect(toggleMovement)
ADVERTISEMENTREMOVE ADS

Comments

8 comments
to add a comment
Ra

Um the script isn't showing for me and it won't let me edit it so if you have problems to just wait a few minutes and then it should be there

0
0
yk

@Randomahhdeveloper can you make a d1s3ord?

0
0
Ra

@ykk uhm maybe, also im sorry for the wait

0
0
Ra

@ykk ok the script is now updated

0
0
Ra

@ykk also if you help me(aka carry me) I can get a discord put out

0
0
yk

@Randomahhdeveloper ya i can, what's ur user?

0
0
ue

@Randomahhdeveloper why did you report this post?

0
0
Ra

@uerd im sorry I forgot I did that i fixed it now

0
0
ADVERTISEMENTREMOVE ADS