Coding your ideas on Roblox Studio - Everything turns black!
JOIN THE DISCORD: https://discord.gg/kd485RBgCG
CODE:
local part = script.Parent
local debounce = false
local function makeEverythingBlack()
-- Change lighting
local lighting = game:GetService("Lighting")
lighting.Ambient = Color3.new(0, 0, 0)
lighting.OutdoorAmbient = Color3.new(0, 0, 0)
lighting.Brightness = 0
-- Change all parts to black
for _, obj in pairs(game.Workspace:GetDescendants()) do
if obj:IsA("BasePart") then
obj.Color = Color3.new(0, 0, 0)
obj.Material = Enum.Material.SmoothPlastic
end
end
end
local function onTouch(hit)
if debounce then return end
debounce = true
local character = hit.Parent
if character and character:FindFirstChild("Humanoid") then
makeEverythingBlack()
end
end
part.Touched:Connect(onTouch)
Learn how to make everything in your Roblox game turn black when a player touches a part — using a simple and powerful Lua script in Roblox Studio!
This idea came straight from one of my students, and in this tutorial, I show you how to bring it to life step-by-step.
🎯 What you’ll learn:
How to detect when a part is touched
How to change all part colors to black
How to adjust lighting to make the entire game go dark
💡 Perfect for horror games, dramatic scenes, secret rooms, or pranks!
📥 Copy and paste the code from the video
🧠 Beginner-friendly scripting tutorial
Don’t forget to 👍 Like, 🔔 Subscribe, and 💬 Comment your own ideas — I might turn them into the next video!
Видео Coding your ideas on Roblox Studio - Everything turns black! канала Nobel Courses
CODE:
local part = script.Parent
local debounce = false
local function makeEverythingBlack()
-- Change lighting
local lighting = game:GetService("Lighting")
lighting.Ambient = Color3.new(0, 0, 0)
lighting.OutdoorAmbient = Color3.new(0, 0, 0)
lighting.Brightness = 0
-- Change all parts to black
for _, obj in pairs(game.Workspace:GetDescendants()) do
if obj:IsA("BasePart") then
obj.Color = Color3.new(0, 0, 0)
obj.Material = Enum.Material.SmoothPlastic
end
end
end
local function onTouch(hit)
if debounce then return end
debounce = true
local character = hit.Parent
if character and character:FindFirstChild("Humanoid") then
makeEverythingBlack()
end
end
part.Touched:Connect(onTouch)
Learn how to make everything in your Roblox game turn black when a player touches a part — using a simple and powerful Lua script in Roblox Studio!
This idea came straight from one of my students, and in this tutorial, I show you how to bring it to life step-by-step.
🎯 What you’ll learn:
How to detect when a part is touched
How to change all part colors to black
How to adjust lighting to make the entire game go dark
💡 Perfect for horror games, dramatic scenes, secret rooms, or pranks!
📥 Copy and paste the code from the video
🧠 Beginner-friendly scripting tutorial
Don’t forget to 👍 Like, 🔔 Subscribe, and 💬 Comment your own ideas — I might turn them into the next video!
Видео Coding your ideas on Roblox Studio - Everything turns black! канала Nobel Courses
Roblox Studio Game Design Roblox RobloxStudio RobloxScripting LuaScript RobloxTutorial GameDev RobloxGameDevelopment BeginnerCoding CodingForKids TouchScript RobloxEffects DarkModeRoblox ScriptingTutorial RobloxBeginners LearnToCode GameDesign RobloxGameIdeas StudentProjects RobloxStudioTips SimpleScripts RobloxDevTips
Комментарии отсутствуют
Информация о видео
21 марта 2025 г. 16:00:06
00:03:36
Другие видео канала