How to print a value

i can’t output any message, pls help

--!strict
export type Cameras = "Camera1" | "Camera2"
local module = {}
function module.new(camera:Cameras)
   local self = setmetatable({cameratype = camera}, {__index = module} )
   prant(self.cameratype)  --error
   return self
end

return module

The issue will be with the script executing this constructor, could you show that part of the code please?

prant(self.cameratype) --error

Why are you doing prant? charr

If you want to output something in the console the function is print() to do that, not prant.

prant(self.cameratype) --error

anyway then it’s dont output, i cant see any value

Show us the code where you create the module object

--!strict
require(script.ModuleScript).new("Camera2") -- b

Well i think your isssue is you are using prant not print

I’ve tried the code and it works for me with print instead of prant, can I see your updated code?

--a
--c
--camera
--camera1
--camera2
--!strict
export type Cameras = "Camera1" | "Camera2"
local module = {}
function module.new(camera:Cameras)
   local self = setmetatable({cameratype = camera}, {__index = module} )
   error(self.cameratype)  --error
   return self
end

return module

I told you to use print here not the error function.

1 Like

then it’s dont print, another ways?

It prints for me? I’ve tried your code.

This should work??? lol char

do if error == true then error = not true tihs will fix all error works 100%

bro you can’t script, it’s not work

What do you mean? It does work?
image