local tool = script.Parent
local rf = game.ReplicatedStorage.remotes:WaitForChild("bullet")

local shooting = false
tool.Activated:Connect(function()
	if shooting == false then
		shooting = true
		local player = game.Players:GetPlayerFromCharacter(tool.Parent)
		local mousehitvec = rf:InvokeClient(player)
		print("ez")
		local rayparams = RaycastParams.new()
		rayparams.FilterType = Enum.RaycastFilterType.Blacklist
		local raynew = workspace:Raycast(tool.Pointgun.Position, mousehitvec, rayparams)
		print("not ez")
		if raynew then
			print("The thing that the ray touched was " .. raynew.Instance:GetFullName())
			print("not ez")	
		else print("u bad iam")
			print("not ez")	
		end
		wait(1)	
		shooting = false
	end
end)

2 comments

0

Does the tool work otherwise? I am Meaning does it still work even tho the print doesn't work?

0

Sorry for my bad explanation, resuming the script works until the if raynew. It always print the thing after else EVEN if I shoot on a part or something else.