mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 14:51:55 +00:00
Idea: use euler angles instead for flashlight UDP, also brightness 1
This commit is contained in:
@@ -86,7 +86,7 @@ function Actions:EnableFlashlight(FlashlightKey: Enum.KeyCode)
|
||||
|
||||
task.spawn(function()
|
||||
while Actions.FlashlightEnabled do
|
||||
FlashlightRemote:FireServer(self.CurrentCamera.CFrame)
|
||||
FlashlightRemote:FireServer(table.pack(self.CurrentCamera.CFrame:ToEulerAnglesXYZ()))
|
||||
Delta:time()
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -10,6 +10,10 @@ type FlashlightUDP = RBXScriptConnection
|
||||
type LocalPlayer = Player
|
||||
type HumanoidRootPart = BasePart
|
||||
|
||||
type EulerXYZ_struct = {
|
||||
[number | string]: number
|
||||
}
|
||||
|
||||
Flashlight.Enabled = false
|
||||
|
||||
local CharacterShared = _G.include(script, "CharacterShared")
|
||||
@@ -49,9 +53,10 @@ function Flashlight.constructor(LocalPlayer: LocalPlayer, HumanoidRootPart: Huma
|
||||
if FlashlightUDP_Event then
|
||||
warn("[Server Flashlight]: UDP event was already created, duplicating...", debug.traceback())
|
||||
end
|
||||
FlashlightUDP_Event = Flashlight_UDP.OnServerEvent:Connect(function(Messenger: Player, CameraCFrame: CFrame)
|
||||
FlashlightUDP_Event = Flashlight_UDP.OnServerEvent:Connect(function(Messenger: Player, CameraEuler: EulerXYZ_struct)
|
||||
if Messenger.UserId == LocalPlayer.UserId then
|
||||
FlashlightPart.CFrame = CameraCFrame
|
||||
-- FlashlightPart.CFrame = CameraCFrame
|
||||
-- print((HumanoidRootPart.Position-CameraCFrame.Position).Magnitude)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ type LightingProps = { [string]: Color3 | number | boolean | string }
|
||||
|
||||
local Lighting_PropsTree: LightingProps = {
|
||||
["Ambient"] = Color3.fromRGB(40,40,40),
|
||||
["Brightness"] = 2,
|
||||
["Brightness"] = 1,
|
||||
["ColorShift_Bottom"] = Color3.new(0,0,0),
|
||||
["ColorShift_Top"] = Color3.new(0,0,0),
|
||||
["EnvironmentDiffuseScale"] = 1,
|
||||
|
||||
Reference in New Issue
Block a user