Ideas On How To Make An Orb That Reduces Your Vision?

Alright, you’d probably want to fire a ray between every (alive) player every server heartbeat.

And if you detect a hit on a player send them a request saying “hey you’ve been hit, do the effects now”

This is done using RunService.

local runService = game:GetService("RunService")

runService.Heartbeat:Connect(function(step)
    for i, plr in ipairs(game.Players:GetChildren()) do
        -- fire ray from orb to player, if it hits players send them effect request.
        -- otherwise do nothing.
    end
end)

It didn’t seem to print anything when using this.

Nothing happens in that code, it’s just showing you the structure and you’ll have to do the rest.

I already put my code inside but it did nothing

Can you send what you’re doing now.

local Orb = script.Parent
local aggroDist = 100
local Atmos = game.Lighting.Atmosphere

local runService = game:GetService("RunService")

runService.Heartbeat:Connect(function(step)
	
	local target = nil
	
	for i, plr in ipairs(game.Players:GetChildren()) do
		local Human = plr:FindFirstChild("Humanoid")
		local Torso = plr:FindFirstChild("Torso")
		if Human and Torso then
			if (Torso.Position - Orb.Position).Magnitude < aggroDist then

				local bulletRay = Ray.new(Orb.Position, (Torso.Position - Orb.Position).Unit*500)
				local hit, position = game.Workspace:FindPartOnRayWithIgnoreList(bulletRay, {Orb})
				if hit == Torso then
					target = Torso
					print("Been Hit")
				else
					print("Something Is Blocking")
				end
			end
		end
	end
end)

Oh Player has no humanoid object, the player’s character does which is seperate from the Player class itself.

Luckily, it’s as easy as doing local player = plr.Character

Ok so now the printing works and it all runs well however it still randomly detects an invisible object blocking the ray to my torso causing it to print “Something Is Blocking”. Is there any way to fix this?

Instead of checking for your Torso, check for your HumanoidRootPart.

Wow it actually worked better. Only one more problem is that I can’t change the RGB value of the atmosphere using color3.new. It only allows me to do red, green and blue one at a time but that creates a stack error and doesn’t change the colour at all.

Of course, instead of checking every second it now checks every server frame!

As with the atmosphere color it is just a Color3, so can you show me how you’re changing it.

I’m doing either this:

Atmos.Color.R = "123"
Atmos.Color.G = "33"
Atmos.Color.B = "87"

or this:

Atmos.Color.Color3.new(123,33,87)

Ah, I see what your doing wrong.

You want to set the value of it, not attempt to reference Color3 from Color

It’s like this
Atmos.Color = Color3.new(123,33,87)

Doing this gave me no errors which is an improvement but it doesn’t actually change the colour of the atmosphere.

What are your current settings in the atmosphere?

Density = 0.3
Offset = 0.25
Colour = 199,199,199
Decay = 106,112,105
Glare = 0
Haze = 0

Turn the haze up a bit, it’ll make the effect a lot more noticeable.

I think the while loop is repeatedly adding on the haze causing it to make my screen completely white.

It’s late for me, I’ll help you again tommorow.