-- Define the experience IDs
local experienceID1 = "3478678937"
local experienceID2 = "1430993116" -- Replace with your other experience ID
-- Fetch the current game ID and convert to string for consistency
local currentExperienceID = tostring(game.GameId)
-- Debug output to check current experience ID
print("Current Experience ID: " .. currentExperienceID)
-- Function to execute the first script for experienceID1
local function executeFirstScript()
local repo =
'https://raw.githubusercontent.com/violin-suzutsuki/LinoriaLib/main/'
local Library = loadstring(game:HttpGet(repo .. 'Library.lua'))()
local ThemeManager = loadstring(game:HttpGet(repo ..
'addons/ThemeManager.lua'))()
local SaveManager = loadstring(game:HttpGet(repo .. 'addons/SaveManager.lua'))
()
local Window = Library:CreateWindow({
Title = 'My Custom Menu',
Center = true,
AutoShow = true,
})
-- Add Tabs
local Tabs = {
Main = Window:AddTab('Main'),
UI_Settings = Window:AddTab('UI Settings'),
}
local LeftGroupBox = Tabs.Main:AddLeftGroupbox('Game Settings')
local TeleportGroupBox = Tabs.Main:AddLeftGroupbox('Teleport to Grass Objects')
local LoopGroupBox = Tabs.Main:AddLeftGroupbox('Action Interval') -- New group
box
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local workspace = game:GetService("Workspace")
local grassObjects = workspace:WaitForChild("GrassObjects")
-- Variables for action loop
local actionEnabled = false -- To track when the action loop is running
local actionInterval = 1 -- Default interval for actions
local actionCoroutine = nil -- Track action coroutine
-- Variables for path following
local pathPoints = {}
local lineParts = {}
local delayTime = 0
local delayEnabled = false
local repeatPathEnabled = false
-- Variable to determine if teleportation to grass objects is enabled
local teleportToGrassEnabled = false
local teleportSpeed = 1 -- Default speed multiplier for teleportation
local teleportRange = 50 -- Default teleport range
local teleportCoroutine = nil -- Track the teleportation coroutine
local originalColliderSize = Vector3.new(1, 1, 1) -- Original size of the
GrassCollider for resetting purpose
local changingCollider = false -- Variable to track if collider size change is
active
local actionCoroutine = nil -- Track action coroutine
local actionInterval = 1 -- Default interval for actions
local actionEnabled = false -- To track when the action loop is running
-- Function to continuously teleport to grass objects
local function startTeleportation()
teleportCoroutine = coroutine.create(function()
while teleportToGrassEnabled do
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
local currentPosition = humanoidRootPart.Position
-- Loop through all children in GrassObjects
for _, object in ipairs(grassObjects:GetChildren()) do
if object.Name == "g" then
local distance = (object.Position -
currentPosition).Magnitude
if distance <= teleportRange then
-- Teleport to the object's position
humanoidRootPart.CFrame = object.CFrame
wait(teleportSpeed) -- Speed of teleportation
if not teleportToGrassEnabled then break end -- Check
again if we need to stop
end
end
end
wait(0) -- Adjust as necessary
end
end)
coroutine.resume(teleportCoroutine)
end
-- Placeholder function for the action to loop
local function actionToLoop()
-- Replace this line with whatever action you want to perform
print("Action executed!") -- Placeholder action
end
-- Function to start the action loop
local function startActionLoop()
if actionCoroutine then return end -- Prevent starting a new loop if
already running
actionCoroutine = coroutine.create(function()
while actionEnabled do
actionToLoop() -- Execute the action
wait(actionInterval) -- Wait for the specified interval
end
end)
coroutine.resume(actionCoroutine)
end
-- Placeholder function for the action to loop
local function actionToLoop()
-- Change the size of the GrassCollider or desired object
local grassCollider = workspace:FindFirstChild("GrassCollider")
if grassCollider then
local collider = grassCollider:FindFirstChild("GrassCollider")
if collider then
collider.Size = Vector3.new(128, 128, 128) -- Set size to 128, 128,
128
print("GrassCollider size set to (128, 128, 128)")
else
warn("GrassCollider child not found inside GrassCollider!")
end
else
warn("GrassCollider not found in workspace!")
end
end
local function drawPath()
if #pathPoints < 2 then return end
local startPoint = pathPoints[#pathPoints - 1]
local endPoint = pathPoints[#pathPoints]
local line = Instance.new("Part")
line.Size = Vector3.new(0.4, 0.4, (endPoint - startPoint).Magnitude)
line.Anchored = true
line.BrickColor = BrickColor.new("Bright blue")
line.Material = Enum.Material.Neon
line.Position = (startPoint + endPoint) / 2
line.CFrame = CFrame.lookAt(line.Position, endPoint)
line.Parent = workspace
line.CanCollide = false
table.insert(lineParts, line)
end
-- Functie om de avatar langs het pad te laten lopen
local function followPath(reverse)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid then
print("Geen humanoid gevonden!")
return
end
local pointsToFollow = (reverse and pathPoints) or pathPoints
for i = (reverse and #pointsToFollow or 1), (reverse and 1 or
#pointsToFollow), (reverse and -1 or 1) do
local currentPoint = pointsToFollow[i]
humanoid:MoveTo(currentPoint)
local reached = humanoid.MoveToFinished:Wait()
if delayEnabled then
wait(delayTime)
end
if not reached then
print("Beweging niet voltooid naar punt:", currentPoint)
break
end
end
print("Pad gevolgd!")
end
-- Function to start the action loop
local function startActionLoop()
if actionCoroutine then return end -- Prevent starting a new loop if
already running
actionCoroutine = coroutine.create(function()
while actionEnabled do
actionToLoop() -- Execute the action (change size)
wait(actionInterval) -- Wait for the specified interval
end
end)
coroutine.resume(actionCoroutine)
end
-- Teleport to Grass Objects Toggle
TeleportGroupBox:AddToggle('TeleportToGrassToggle', {
Text = 'Enable Teleport to Grass Objects',
Default = false,
Tooltip = 'Enable this to teleport to grass objects named "g".',
Callback = function(Value)
teleportToGrassEnabled = Value
if Value then
startTeleportation() -- Start the teleportation loop
else
if teleportCoroutine then
teleportToGrassEnabled = false -- Stop the loop
if coroutine.status(teleportCoroutine) == "suspended" then
coroutine.resume(teleportCoroutine) -- Resume if it's
suspended
end
end
end
end,
})
-- New Slider for Action Interval
LoopGroupBox:AddSlider('ActionIntervalSlider', {
Text = 'Action Interval (s)',
Default = 1,
Min = 0.1,
Max = 10,
Rounding = 1,
Increment = 0.1, -- Allows adjusting by 0.1 increments
Callback = function(Value)
actionInterval = Value
print("Action interval set to:", actionInterval)
if actionEnabled then
startActionLoop() -- Restart the action loop to reflect the new
interval
end
end,
})
-- Toggle to enable/disable action loop
LoopGroupBox:AddToggle('EnableActionLoop', {
Text = 'Enable Action Loop',
Default = false,
Tooltip = 'Enable this to start running the action every X seconds.',
Callback = function(Value)
actionEnabled = Value
if Value then
startActionLoop() -- Start the action loop
else
actionCoroutine = nil -- Stop the action loop
end
end,
})
-- Slider for Teleport Speed
TeleportGroupBox:AddSlider('TeleportSpeedSlider', {
Text = 'Teleport Speed',
Default = 1,
Min = 1,
Max = 100,
Rounding = 0,
Callback = function(Value)
teleportSpeed = Value
print("Teleport speed set to:", teleportSpeed)
end
})
-- Slider for Teleport Range
TeleportGroupBox:AddSlider('TeleportRangeSlider', {
Text = 'Teleport Range',
Default = 50,
Min = 10,
Max = 200,
Rounding = 0,
Callback = function(Value)
teleportRange = Value
print("Teleport range set to:", teleportRange)
end
})
-- Slider for walk speed
LeftGroupBox:AddSlider('WalkSpeedSlider', {
Text = 'Walk Speed',
Default = 16,
Min = 16,
Max = 100,
Rounding = 0,
Callback = function(Value)
if character:FindFirstChildOfClass("Humanoid") then
character:FindFirstChildOfClass("Humanoid").WalkSpeed = Value
end
end
})
-- Checkbox to enable delay
LeftGroupBox:AddToggle('DelayToggle', {
Text = 'Enable Delay',
Default = false,
Tooltip = 'Enable this to set a delay between points.',
Callback = function(Value)
delayEnabled = Value
end
})
-- Slider to set delay time
LeftGroupBox:AddSlider('DelaySlider', {
Text = 'Delay Time (s)',
Default = 0,
Min = 0,
Max = 5,
Rounding = 1,
Callback = function(Value)
if Value < 0 then Value = 0 end
delayTime = Value
end,
})
-- Checkbox to repeat the path
LeftGroupBox:AddToggle('RepeatPathToggle', {
Text = 'Repeat Path',
Default = false,
Tooltip = 'Enable this to repeat the path without removing it.',
Callback = function(Value)
repeatPathEnabled = Value
if repeatPathEnabled then
coroutine.wrap(function()
while repeatPathEnabled do
if #pathPoints > 1 then
followPath() -- Go forward
followPath(true) -- Go backward
else
print("Add more points to the path.")
end
wait(delayTime) -- Wait between repetitions
end
end)() -- Start the loop in a coroutine
end
end
})
-- Reset path
LeftGroupBox:AddButton({
Text = 'Reset Path',
Func = function()
pathPoints = {}
for _, line in ipairs(lineParts) do
line:Destroy()
end
lineParts = {}
print("Path cleared!")
end
})
-- Add current position to the path
LeftGroupBox:AddButton({
Text = 'Add Point to Path',
Func = function()
local position = character.HumanoidRootPart.Position
table.insert(pathPoints, position)
drawPath()
print("Point added:", position)
end,
})
-- UI settings tab
local MenuGroup = Tabs.UI_Settings:AddLeftGroupbox('Menu Options')
MenuGroup:AddButton('Unload', function() Library:Unload() end)
MenuGroup:AddLabel('Close menu with the key:'):AddKeyPicker('MenuKeybind',
{ Default = 'End', NoUI = true, Text = 'Menu Key' })
Library.ToggleKeybind = Options.MenuKeybind
-- OnUnload function
Library:OnUnload(function()
print('Unloaded!')
Library.Unloaded = true
end)
-- Hand the library over to our managers
ThemeManager:SetLibrary(Library)
SaveManager:SetLibrary(Library)
-- Build our configuration menu on the right side of our tab
SaveManager:SetFolder('MyScriptHub/specific-game')
SaveManager:BuildConfigSection(Tabs['UI Settings'])
-- Build our theme menu on the left side
ThemeManager:ApplyToTab(Tabs['UI Settings'])
-- Load the autoload configuration
SaveManager:LoadAutoloadConfig()
end
-- Function to execute the second script for experienceID2
local function executeSecondScript()
print("Executing second script for experience ID 2")
end
-- Main script execution based on the experience ID
if currentExperienceID == experienceID1 then
executeFirstScript()
elseif currentExperienceID == experienceID2 then
executeSecondScript()
else
warn("Unhandled experience ID: " .. currentExperienceID)
end