I was looking through the Creator Documentation and found a sample code made by Roblox. In this code, I noticed some unfamiliar syntax and was wondering what is was.
Variable Declarations with “: :”
local player = Players.LocalPlayer :: Player
local playerScripts = player:FindFirstChild("PlayerScripts") :: PlayerScripts
local playerModuleBase = playerScripts:WaitForChild("PlayerModule") :: ModuleScript
local playerModule = require(playerModuleBase) :: any
Functions with “:”
local function setCameraControlsEnabled(enabled: boolean)
-- Toggle between Scriptable and Custom camera types to disable or enable camera control respectively
if Workspace.CurrentCamera then
Workspace.CurrentCamera.CameraType = if enabled then Enum.CameraType.Custom else Enum.CameraType.Scriptable
end
end
local function setDoorOpen(door, open: boolean)
-- When a door is open, it should be able to be walked through and the proximity prompt should be disabled
-- When the door is closed, the opposite applies
door.Entrance.ProximityPrompt.Enabled = not open
door.Entrance.CanCollide = not open
end
Could someone please explain these things to me and their potential uses?