anti exploit remotes and skybox script

This commit is contained in:
2024-03-03 19:46:46 -05:00
parent 1af1c6919e
commit 6000e80164
5 changed files with 49 additions and 16 deletions

View File

@@ -36,6 +36,8 @@ function Actions.constructor(LocalPlayer: LocalPlayer)
else
warn(`[Server Actions]: Got an unknown type, Key="{typeof(Key)}" Value="{Key}" from: "{Messenger.Name}"`)
end
else
Messenger:Kick(`"{Messenger.Name}", {Messenger.UserId} r="{Remote.Name}", 1="{tostring(Key)}"`)
end
end)

View File

@@ -59,15 +59,16 @@ function Flashlight.constructor(LocalPlayer: LocalPlayer, HumanoidRootPart: Huma
warn("[Server Flashlight]: UDP event was already created, duplicating...", debug.traceback())
end
FlashlightUDP_Event = Flashlight_UDP.OnServerEvent:Connect(function(Messenger: Player, CameraEuler: EulerXYZ_struct)
--The compiler/optimization level should inline this
local ExtraCheck = CameraEuler[4] and CameraEuler[4] == 3
if Messenger.UserId == LocalPlayer.UserId and ExtraCheck then
if Messenger.UserId == LocalPlayer.UserId then
if CameraEuler[4] and CameraEuler[4] == 3 then
local RootPartCFrame = HumanoidRootPart.CFrame
FlashlightPart.CFrame = CFrame.new(
RootPartCFrame.X,
RootPartCFrame.Y+Flashlight.HeadHeight,
RootPartCFrame.Z)*CFrame.Angles(CameraEuler[1],CameraEuler[2],CameraEuler[3])
RootPartCFrame.Z)*CFrame.Angles(CameraEuler[1], CameraEuler[2], CameraEuler[3])
end
else
Messenger:Kick(`"{Messenger.Name}", {Messenger.UserId} r="{Flashlight_UDP.Name}", 1="{tostring(CameraEuler)}"`)
end
end)

View File

@@ -76,6 +76,8 @@ end);
--reset
print("TODO reached -", script.Name..".lua")
end
else
Messenger:Kick(`"{Messenger.Name}", {Messenger.UserId} r="{Spine.Remote.Name}", 1="{tostring(CameraPosition)}", 2="{tostring(IsFirstPerson)}"`)
end
end)

View File

@@ -2,10 +2,14 @@
--!native
--!strict
local Lighting = game:GetService("Lighting")
type LightingProps = { [string]: Color3 | number | boolean | string }
export type Effects = {
ColorCorrection: ColorCorrectionEffect
}
local Lighting = game:GetService("Lighting")
local Lighting_PropsTree: LightingProps = {
["Ambient"] = Color3.fromRGB(40,40,40),
["Brightness"] = 1,
@@ -25,13 +29,33 @@ local Lighting_PropsTree: LightingProps = {
["FogStart"] = 100000,
}
export type Effects = {
ColorCorrection: ColorCorrectionEffect
}
local function Skybox(): (Sky, Atmosphere)
local SkyBox = Instance.new("Sky") :: Sky
SkyBox.SkyboxBk = "rbxassetid://48020371"
SkyBox.SkyboxDn = "rbxassetid://48020144"
SkyBox.SkyboxFt = "rbxassetid://48020234"
SkyBox.SkyboxLf = "rbxassetid://48020211"
SkyBox.SkyboxRt = "rbxassetid://48020254"
SkyBox.SkyboxUp = "rbxassetid://48020383"
SkyBox.MoonTextureId = ""
SkyBox.StarCount = 500
local Atmosphere = Instance.new("Atmosphere") :: Atmosphere
Atmosphere.Density = .429
Atmosphere.Offset = 0
Atmosphere.Color = Color3.new(0,0,0)
Atmosphere.Decay = Color3.new(0,0,0)
Atmosphere.Glare = .1
Atmosphere.Haze = 1.5
return SkyBox, Atmosphere
end
return function(): Effects
Lighting:ClearAllChildren()
--VFX Effects for later
local ColorCorrection = Instance.new("ColorCorrectionEffect")
local ColorCorrection = Instance.new("ColorCorrectionEffect") :: ColorCorrectionEffect
ColorCorrection.Parent = Lighting
for Light_Prop, Light_Value in Lighting_PropsTree do
@@ -43,6 +67,10 @@ return function(): Effects
end
end
local Sky, Atmosphere = Skybox()
Sky.Parent = Lighting
Atmosphere.Parent = Lighting
return {
ColorCorrection = ColorCorrection
}

View File

@@ -23,7 +23,7 @@ local EditorEntities = Instance.new("BindableFunction")
EditorEntities.Name = "StudioIndexedEntities"
EditorEntities.Parent = ServerStorage
local StudioEntities = HideEditorEntities.indexAll(not RS:IsStudio())
local StudioEntities = HideEditorEntities.indexAll(not false)
StarterPlayer_Stuff()
Lighting_Stuff()