hello
I need help with a sun Script
it kills the player if he get’s any sunlight every (any)
here is the error if that help’s
RunService:fireRenderStepEarlyFunctions unexpected error while invoking callback: Poition is not a valid member of Part “Workspace.zeinbanana882.HumanoidRootPart”
did I see Any help no
ty if you helped me
local sunDirection = game.Lighting:GetSunDirection()
local sun_Detect = 10000
local coolDown = 0
local coolDownDuration = 1
local Safe = true
local Burning = false
function BurnPlayer()
character.Humanoid.TakeDamage(5)
Burning = false
coolDown = coolDownDuration
end
function Safe()
if Burning == true then
Burning = false
end
end
game:GetService("RunService"):BindToRenderStep("SunService", Enum.RenderPriority.Camera.Value + 1, function(deltaTime)
local ray = Ray.new(character.HumanoidRootPart.Poition, sunDirection,sun_Detect)
local PartFound = workspace:FindPartOnRay(ray, character)
if PartFound then
Safe = true
print("your good")
Safe()
else
Safe = false
coolDown = math.max(0, coolDown, deltaTime)
if coolDown <= 0 then
if Burning == false then
Burning = true
BurnPlayer()
else
coroutine.yield()
end
end
print ("Find Player")
end
end)
game.Lighting:GetPropertyChangedSignal("TimeOfDay"):Connect(function()
sunDirection = game.Lighting:GetSunDirection()
end)