#is there any way to have a custom character type
1 messages · Page 1 of 1 (latest)
wdym exactly
Humanoid is not a valid member of Model "Workspace.Player1"
whats happens when i try to set the humanoid
You can't validate the type on run time im afraid but you can create the type like this
type CustomChar = typeof(path.to.char)
local HChar: CustomChar = Player.Character
cant i make it a table ?
you can make it a table yeah and if check every single component manually
I think there are modules online that do this tho
type checking at run time
i dont think i fully understand ?
function test(self:BallInstance,Character:Model)
local Character : Character = Character :: Character
print(typeof(Character))
self._holdercharacter = assert(Character,"Invalid Character") :: Character
self._holdercharacter["Humanoid"] = assert(Character:FindFirstChildWhichIsA("Humanoid") :: Humanoid,"Character with no humanoid ????")
self._holdercharacter["Animator"] = assert(self._holderhumanoid:WaitForChild("Animator") :: Animator?)
self._holdercharacter["HumanoidRootPart"] = assert(Character:WaitForChild("HumanoidRootPart") :: BasePart,"HRP not found!")
end