Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a place with lightness only 4 feet around the player and the whole other map dark?

Asked by 10 years ago

If you can, Please put the script down. THX

1 answer

Log in to vote
0
Answered by
jobro13 980 Moderation Voter
10 years ago

You should set the time of day to 03:00:00 and the brightness of lighting to 0. You do this to create a very, very dark night. To do this, go to the explorer and find "Lighting". Make sure you have the properties window open. Now select Lighting. Find the TimeOfDay property and type in that field "03" and hit return. Then set Brightness to 0 (also a property of lighting).

Now open Basic Objects and insert a script. You can insert this in either Workspace, ServerStorage or ServerScriptStorage. Then past the script I provide you.

This scripts connects to an event which gets fired every time a player joins. It then connects to this player to an event which fires when a character is added. If a character is added, it waits until a Head is present and it will then insert a PointLight which is the lighting source you are searching. It sets the range to 4 (this "4 feet" you told about - this is VERY small though! You may want to edit this) and then it's done!

game.Players.PlayerAdded:connect(function(p)
    p.CharacterAdded:connect(function(char)
        repeat wait() until char:FindFirstChild("Head")
        Iocal light = Instance.new("PointLight", char.Head)
        light.Range = 4
    end)
end)
0
I am REALLY new to this scripting, so if you can, please go into more detail? Villadrone 0 — 10y
0
Okay, no problem! Check my edit :) jobro13 980 — 10y
Ad

Answer this question