You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
the knife actually landing where its supposed to on the client and server -
What is the issue? Include screenshots / videos if possible!
the knifes landing position dosent land correctly on the client
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
ive tried using the normal .touched, setting the networkowner to nil and player, using entered touched from the module, and etc.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
the servercode for the knife:
local tool = script.Parent
local KnifeSpeed = 1
script.Parent.Communicate.OnServerEvent:Connect(function(plr, request, mouseCF)
local char = tool.Parent
if plr == game.Players:GetPlayerFromCharacter(char) then
local hum = char:FindFirstChildOfClass("Humanoid")
if request == "Held" then
local DebugPart = Instance.new("Part",workspace)
DebugPart.CFrame = mouseCF
DebugPart.Size = Vector3.new(1,1,1)
DebugPart.Anchored = true
DebugPart.Material = Enum.Material.Neon
DebugPart.Color = Color3.new(1,0,0)
local knifemodel = script.Parent.Handle.Knife:Clone()
knifemodel.Name = (plr.Name.."'s thrown knife")
knifemodel.Parent = workspace
knifemodel.WeldConstraint:Destroy()
knifemodel.CFrame = CFrame.new(knifemodel.Position,mouseCF.Position)
local dir = (mouseCF.Position - knifemodel.Position).Unit * KnifeSpeed * 100
local Vel = Instance.new("BodyVelocity",knifemodel)
Vel.Velocity = dir
local att = Instance.new("Attachment",knifemodel)
local AngVel = Instance.new("AngularVelocity",knifemodel)
AngVel.AngularVelocity = Vector3.new(-10 * KnifeSpeed,00,0)
AngVel.MaxTorque = math.huge
AngVel.Attachment0 = att
AngVel.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
knifemodel:SetNetworkOwner(nil)
knifemodel.StabBox:SetNetworkOwner(nil)
local HitboxModule = require(game.ReplicatedStorage.HitboxModuleMain)
local Params = OverlapParams.new()
Params.FilterType = Enum.RaycastFilterType.Exclude
Params.FilterDescendantsInstances = {knifemodel}
local Hitbox = HitboxModule:CreateWithPart(knifemodel.StabBox, Params)
Hitbox:Start()
local Items = Hitbox:GetItems()
Hitbox.Entered:Connect(function(hit)
if hit.Parent:IsDescendantOf(script.Parent.Parent) == true or hit.Parent == char then
return
end
print(hit:GetFullName())
knifemodel.Anchored = true
task.wait()
knifemodel.CFrame = knifemodel.CFrame
end)
end
end
end)
the module in question thats being used:
(keep in mind that this still applies when using default roblox functions, not just the module.)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.