How to fix my knife client script and server script?

can you show me a video of the feature you scripted?

1 Like

did not quite understand that please more context

1 Like

i just scripted the thing you guys gave me that’s all

1 Like

Make a video of you trying the script in-game

1 Like

can you send a video / photo of the code and the ReplicatedStorage?

1 Like

server script:


client script:

replicated storage:
re

1 Like

Oh yea I forgot to add a check if the tool is equipped, but can you add a video of you playing the game with the output?

1 Like

And add prints(“”) to see if the function runs

1 Like

@RedOver133 @YourPlxDev I found the problem in the client remove the Knife from the ThrowKnifeEvent:FireServer(Knife, HitPosition) Remove the Knife Variable so it would look like this
ThrowKnifeEvent:FireServer( HitPosition)

2 Likes

still not the issue not fixed :sob:

1 Like

Whats the Mesh is that the mesh of the knife or the main tool?

1 Like

the knife mesh is the mesh child of tool

1 Like

Can I see a image of the tool opened to see the objects

1 Like

jh
here

1 Like

Add prints to the functions to see if they run? and say what functions run?

1 Like

its says nothing doesn’t type anything

1 Like

What happens when you use the knife"?

1 Like

like a tool without any scripts

1 Like

With the scripts when you use it what happens

1 Like

I made my own knife system heres the some of the code: function ThrowKnife(Player, Tool, MouseHit)

-- Clone
local NewKnife = Assets:WaitForChild("Knife"):Clone()
NewKnife.Parent = workspace
NewKnife:SetNetworkOwner(nil)

-- Properties
NewKnife.CFrame = CFrame.new(Tool.Handle.Position, MouseHit.Position)

-- TweenInfo
local Info = TweenInfo.new(

	0.1,
	Enum.EasingStyle.Linear

)

-- Tween
local Tween = Services["TweenService"]:Create(NewKnife, Info, {CFrame = MouseHit, Orientation = NewKnife.Orientation + Vector3.new(0, 90, 0)})
Tween:Play()

-- Touched
NewKnife.Touched:Connect(function(Part)

	-- Humanoid
	local Humanoid = Part.Parent:FindFirstChild("Humanoid")

	-- Check
	if Player.Character.Humanoid ~= Humanoid then

		-- Check
		if Humanoid then

			-- Kill
			Humanoid.Health = 0

			-- Destory
			Services["Debris"]:AddItem(NewKnife, 0)

		end


	end

	-- Check
	if not Part:IsDescendantOf(Player.Character) then

		-- Tween
		Tween:Cancel()

		-- Change
		NewKnife.Anchored = true
		NewKnife.CanCollide = true

	end

end)

end

1 Like