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
Ar_Link
(Ardev)
#5
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
Ar_Link
(Ardev)
#9
Show us the code where you create the module object
--!strict
require(script.ModuleScript).new("Camera2") -- b
Ar_Link
(Ardev)
#11
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?
--!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.
Ar_Link
(Ardev)
#19
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?