Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Ways to get local Lighting? [Answered]

It's there an official way to do client independent lighting? I realized it can be done enabling FilteringEnabled since changes doesn't replicate. But can it be done in another way?

EDIT: Clarification:

What I want is the ability to change the lighting settings in a client without affecting other clients. I managed to do that exploiting the proprieties of FilteringEnabled, if it is enabled the changes done by a client won't replicate; that means we can change lighting settings in a client and it won't replicate to others. It works, but it's kinda hackish, and if a game relies on client replication then you can't use it. What I want is another way of getting this without enabling FilteringEnabled.

2 answers

✓ Accepted answer

Your method of using FilteringEnabled is the most reliable and only "supported" method for local Lighting. If you are referring to light objects, you can use them the same way you would normally create localparts.

If you want to have local Lighting without using FilteringEnabled, you'll have to exploit the inherent latency between the client and the server.

Here's an example place that does this.

The way this works is simple: using the Changed event of Lighting in a LocalScript allows you to set the Lighting for one Client independently of all others. This works because of latency.

When you update one client, that update (with FilteringEnabled enabled) replicates to the server, which then replicates to the other clients. These two replications take time. Very little, but more than it takes to update Lighting on the client's computer. So, this happens:

With two players:

Player1's Lighting updates. Player1's Lighting is replicated to the Server. Player1's Lighting is replicated to Player2. Player2's Lighting.Changed event fires, updating the Lighting to Player2's settings. Player2's Lighting is replicated to the Server.

And so on. With more players, this simply happens more frequently. It's also wicked fast, on the order of milliseconds.

2 comments

0

I wfote my anserr on a phone woth slow internet connection q.q

1

That's even more hackish than using FilteringEnabled. But it works, so upvote for you.

Store it in the CurrentCamera

2 comments

0

You can't store lighting in the camera. I'm talking about client side lighting, not client side parts

0

Actually, you can store light objects in the Camera, or in the PlayerGui, or wherever else you can get LocalParts, you just have to Parent them to a local part for them to be visible.

This discussion is preserved as it was. New answers, comments, and votes are closed.