New to ClientCaster, I believe i did everything right, but when i try to cast it, this message keeps appearing.
local tool = script.Parent
local plr = script:FindFirstAncestorWhichIsA("Player")
local char = plr.Character or plr.CharacterAdded:Wait()
local ClientCast = require(game.ServerScriptService.ClientCast)
local DmgParams = RaycastParams.new()
DmgParams.FilterDescendantsInstances = {char}
DmgParams.FilterType = Enum.RaycastFilterType.Blacklist
tool.Activated:Connect(function()
local DmgCast = ClientCast:new(tool:FindFirstChild("weaponPlaceholder").sword,DmgParams) -- Unable to cast value to object
DmgCast:Start()
wait(1)
DmgCast:Stop()
end)
But when i tried to cast using a script thats inside of the part it works.
so ideally i believe clientcast is a module. the best i can say is use Default raycast.
if you dunno how to use it :
local raycast = workspace:Raycast(OriginCFrame(where it will start),DirectionCFrame(Where it will go,RaycastParams( i think you already know about that)
2nd possibility for you which could be useful is to check module function and see how it works and then try again
weird, when i did it like this it works, the script is placed inside of the parts thats casting:
local tool = script.Parent.Parent.Parent
local plr = script:FindFirstAncestorWhichIsA("Player")
local char = plr.Character or plr.CharacterAdded:Wait()
local ClientCast = require(game.ServerScriptService.ClientCast)
local params = RaycastParams.new()
params.FilterDescendantsInstances = {char}
params.FilterType = Enum.RaycastFilterType.Blacklist
local cast = ClientCast.new(script.Parent, params)
tool.Activated:Connect(function()
cast:Start()
end)