So i am wondering,
Do i cast a Ray on the Client or Server
I have made a Teleporter Tool only using the Client, works on Server
But I made a Weapon using the Server,
It appears to work so I’m just wondering which is better to use.
local RCP = RaycastParams.new()
RCP.FilterDescendantsInstances = {plr.Character}
RCP.FilterType = Enum.RaycastFilterType.Blacklist
local RCR = workspace:Raycast(Tool.Handle.Position, (mousepos - script.Parent.Handle.Position) * 300,RCP)
if RCR then
local HP = RCR.Instance
local model = HP:FindFirstAncestorOfClass("Model")
if model then
for _,Humanoid in pairs(model:GetChildren()) do
if Humanoid.Name == GS.DesiredHumanoid then -- Gets The Name Specified inside the Module Script, if the Name is Equal to that, it will damage the Humanoid
pcall(function()
TagHumanoid(Humanoid, plr)
Humanoid:TakeDamage(GS.Damage)
end)
end
end
end
end