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

This script won't flash the light, fire the remote events, or even change the camera position?

Asked by 3 years ago

hey. im trying to make a script with camera angles that allows you to activate a flashlight on all the camera angles. the remote events fire depending on which time of day it is, changing the way the camera acts. Here's the script I have:

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local holdingRMB = false
local uis = game:GetService("UserInputService")
local camera = game.Workspace.CurrentCamera
local daycamerapart = game.Workspace:WaitForChild("daycamerapart")
local nightcamerapart = game.Workspace:WaitForChild("nightcamerapart")
local dayevent = game.ReplicatedStorage.Remotes:WaitForChild("daycameraevent")
local nightevent = game.ReplicatedStorage.Remotes:WaitForChild("nightcameraevent")
local lighting = game.Lighting
local lights = {
    light1 = game.Workspace.LightFolder.cameralight1
    light2 = game.Workspace.LightFolder.cameralight2
    light3 = game.Workspace.LightFolder.cameralight3
}

uis.InputBegan:Connect(function(inputt, gameProcessedEvent, lightingProperty)
    if inputt.KeyCode == Enum.KeyCode.Space then
        local function lightingProperty(lighting, player)
            if lightingProperty.ClockTime == 0 * 6 then
                nightevent:FireClient(player)
                if lightingProperty.ClockTime == 7 * 14 then
                    dayevent:FireClient(player)
                    mouse.Button2Down:Connect(function()
                        holdingRMB = true
                    end)
                    mouse.Button2Up:Connect(function()
                        holdingRMB = false
                    end)
                end
            end
        end
    end
end)
while true do
   if holdingRMB then
       light1.Enabled = true
       light2.Enabled = true
       light3.Enabled = true
       else
           light1.Enabled = false
           light2.Enabled = false
           light3.Enabled = false
   end
end
0
Looks like you're forgetting to change the camera position. Unless the second script you have does that. 2_MMZ 1059 — 3y

Answer this question