local player = game:GetService(“Players”).LocalPlayer
local sound = script:WaitForChild(“Sound”)
local runService = game:GetService(“RunService”)
local farmer = workspace.Farmer.HumanoidRootPart
runService.RenderStepped:Connect(function()
farmer.PointLight.Enabled = true
local magnitude = (farmer.Position - player.Character.Head.Position).Magnitude
if magnitude <= 40 then
sound:Play()
elseif magnitude > 40 then
sound:Stop()
end
end)
I would I make it become louder when the player comes near to the farmer?