I have this in my script, How would I reference “flash”?
local flash = Instance.new("SurfaceLight",character:FindFirstChild("HumanoidRootPart")) flash.Name = "Light" flash.Color = Color3.fromRGB(255,234,203) flash.Range = 32 flash.Brightness = 3 flash.Shadows = true lightui.Visible = true
Can’t you just look for something called “Light” in the character’s HumanoidRootPart?
how? Im kinda new to scripting.
Would something like this work?
local Light = character.HumanoidRootPart:WaitForChild("Light")
What im trying to do, is make this light turn off when a remote event is fired, but I can’t seem to do that
Something like this should work. You can pick which one you need based on where the remote’s code is being ran.
local ThisRemote = nil --What your remote is.
ThisRemote.OnServerEvent:Connect(function(Player)
local light = Player.Character.HumanoidRootPart.Light
end)
ThisRemote.OnClientEvent:Connect(function(Player)
local light = Player.Character.HumanoidRootPart.Light
end)
You just need to fire the event from the client and find the character then find the light.
RemoteEvent.OnServerEvent:Connect(function(Player)
local Char = Player.Character
local Light = Char:FindFirstChild("Light")
-- Do whatever you want to Light
end)