--still incomplete, waiting on models
local RunService = game:GetService("RunService")
local Camera = workspace.CurrentCamera
local ToolHandler = {}
ToolHandler.__index = ToolHandler
local Updater
function ToolHandler.Equip(Model : Model, Offset : CFrame, Angle : CFrame)
local prop = {}
prop.Model = Model
Updater = RunService.RenderStepped:Connect(function(delta) --init
Model:PivotTo(Camera.CFrame * Offset * Angle)
end)
return setmetatable(prop, ToolHandler)
end
function ToolHandler:Drop()
print("Dropped tool")
end
return ToolHandler
#cant call method with oop
1 messages · Page 1 of 1 (latest)
you can
you just dont call it
show the script where you require it from
@hot pulsar
damn, uhh this is alward, im outside 💀
nah i def am, it says that it failed to index the method
despite me already setting a metatable and __index metamethod
well
I tried it and it works
local RunService = game:GetService("RunService")
local Camera = workspace.CurrentCamera
local ToolHandler = {}
ToolHandler.__index = ToolHandler
local Updater
function ToolHandler.Equip(Model : Model, Offset : CFrame, Angle : CFrame)
local prop = {}
prop.Model = Model
Updater = RunService.RenderStepped:Connect(function(delta) --init
Model:PivotTo(Camera.CFrame * Offset * Angle)
end)
return setmetatable(prop, ToolHandler)
end
function ToolHandler:Drop()
print("Dropped tool")
end
return ToolHandler```
your module
d:Drop()
my local
and it prints "Dropped tool"