Run it
Copy the script and paste it into your executor.
Players = :()
ReplicatedStorage = :()
UserInputService = :()
Debris = :()
RunService = :()
player = Players.LocalPlayer
PlayerGui = player:()
SAPLING_NAME =
PLANT_COUNT =
PLANT_DISTANCE =
SHOW_BLUEPRINT =
BETWEEN_PLANT_WAIT =
MARKER_LIFETIME =
START_CFRAME = .(
-,
,
-,
-,
,
,
,
,
-,
-,
,
-
)
()
ReplicatedStorage:()
r =
ReplicatedStorage.RemoteEvents:()
r
r
r = ReplicatedStorage:()
r
r
_, obj (ReplicatedStorage:())
obj.Name:() ==
obj
PlantRemote = ()
()
items = :()
items
_, c (items:())
c.Name:():(SAPLING_NAME:())
c
_, c (ReplicatedStorage:())
c:() c:()
c.Name:():(SAPLING_NAME:())
c
backpack = player:()
inv = player:()
containers = { backpack, inv }
_, cont (containers)
cont
_, c (cont:())
c.Name:():(SAPLING_NAME:())
c
(xzPos, defaultY)
origin = .(xzPos.X, (defaultY xzPos.Y) + , xzPos.Z)
rayDir = .(, -, )
rp = RaycastParams.()
rp.FilterDescendantsInstances = { player.Character player }
rp.FilterType = .RaycastFilterType.Blacklist
res = :(origin, rayDir, rp)
res res.Position
res.Position.Y
defaultY xzPos.Y
(pos)
SHOW_BLUEPRINT
p = .()
p.Size = .(, , )
p.Anchored =
p.CanCollide =
p.Transparency =
p.Color = .(, , )
p.Name =
p.CFrame = .(pos + .(, , ))
p.Parent =
Debris:(p, MARKER_LIFETIME)
p
(remote, argTable)
remote
remote.ClassName == remote.InvokeServer
ok = (()
remote:((argTable))
)
ok
remote.ClassName == remote.FireServer
ok = (()
remote:((argTable))
)
ok
(remote, saplingArg, position)
remote
attempts = {
{ saplingArg, position },
{ position, saplingArg },
{ (saplingArg), position },
{ position, (saplingArg) },
}
_, args (attempts)
(remote, args)
.()
(centerPos, count, distance)
sapInst = ()
firstArg = sapInst SAPLING_NAME
i = , .(, count)
angle = ( * .pi / count) * (i - )
x = centerPos.X + .(angle) * distance
z = centerPos.Z + .(angle) * distance
groundY = (.(x, centerPos.Y, z), centerPos.Y)
finalPos = .(x, groundY, z)
(finalPos)
(PlantRemote, firstArg, finalPos)
.(BETWEEN_PLANT_WAIT)
(centerPos, totalCount, distance)
side = .(, .(.(totalCount)))
startOffset = (side - ) /
index =
sapInst = ()
firstArg = sapInst SAPLING_NAME
x = , side -
z = , side -
index >= totalCount
xx = centerPos.X + (x - startOffset) * distance
zz = centerPos.Z + (z - startOffset) * distance
groundY =
(.(xx, centerPos.Y, zz), centerPos.Y)
finalPos = .(xx, groundY, zz)
(finalPos)
(PlantRemote, firstArg, finalPos)
index = index +
.(BETWEEN_PLANT_WAIT)
index >= totalCount
(mode)
originPos = START_CFRAME.Position
mode ==
(originPos, PLANT_COUNT, PLANT_DISTANCE)
(originPos, PLANT_COUNT, PLANT_DISTANCE)
autoPlant =
planting =
()
autoPlant = autoPlant
autoPlant planting
planting =
.(()
autoPlant
()
.()
planting =
)
UserInputService.InputBegan:((input, gpe)
gpe
input.KeyCode == .KeyCode.Q
()
)
screenGui = .()
screenGui.Name =
screenGui.Parent = PlayerGui
button = .()
button.Size = .(, , , )
button.Position = .(, , , )
button.Text =
button.BackgroundColor3 = .(, , )
button.TextColor3 = .(, , )
button.Parent = screenGui
button.MouseButton1Click:(togglePlanting)

99 Nights in the Forest 馃敠