Hello
I need Help with my sun Script or my Plugins is the Problem IDK
The Problem my FPS goes lower and lower
there’s no error’s
I used the Celestial Body Dragger Plugin that move’s the sun were I want
if this Help’s
Here’s the Script
local sunDirection = game.Lighting:GetSunDirection()
local sun_Detect = 10000
local coolDown = 0
local coolDownDuration = 1
local Safe = true
local Burning = false
local function BurnPlayer()
character.Humanoid:TakeDamage(5)
Burning = false
coolDown = coolDownDuration
end
local function SetSafe()
if Burning then
Burning = false
end
end
game:GetService("RunService"):BindToRenderStep("SunService", Enum.RenderPriority.Camera.Value + 1, function(deltaTime)
local ray = Ray.new(character.HumanoidRootPart.Position, sunDirection * sun_Detect)
local PartFound = workspace:FindPartOnRay(ray, character)
if PartFound then
Safe = true
print("you're good")
SetSafe()
else
Safe = false
coolDown = math.max(0, coolDown - deltaTime)
if coolDown <= 0 then
if not Burning then
Burning = true
BurnPlayer()
end
end
print("Find Player")
end
end)
game.Lighting:GetPropertyChangedSignal("TimeOfDay"):Connect(function()
sunDirection = game.Lighting:GetSunDirection()
end)