False positive with Sword Reach Check (RemoteEvents)

I want to make it so when the user equips their sword, it will make a local script fire the server, and then the server will print out if the players sword size is not equal to the regular sword size. I tested this with the regular sword size, but all it does is say “Void_Xiety’s sword appears to have a changed sword size. This users sword has been flagged with Red.” which makes no sense, since I made it so a variable holds the OG sword size, and it will check the size of the sword that I passed from the local script. Something doesn’t make sense, and I cannot seem to find my error.

Please help, this is probably a really simple fix, just point me in the right direction

Also I don’t care about RemoteEvent security right now, I just really need a fix for this particular issue.

If anything more is needed, let me know.

~~ Technical Area ~~

Local Script that is a Child of the “Sword” tool:

local SizeOfSword = script.Parent.Handle.Size

script.Parent.Equipped:Connect(function()
	game.ReplicatedStorage.ReachFlag:FireServer(SizeOfSword)
end)

Script that attempts to print when the LocalScript from before is fired:

local RepStorage = game:GetService("ReplicatedStorage")
local ReachEvent = RepStorage.ReachFlag
local RegularSwordSize = "1, 0.8, 4"

local function onReachRecieved(player, SizeOfSword)
	local Size = SizeOfSword
	if Size ~= RegularSwordSize then
		print(player.Name.."'s sword appears to have a changed sword size. This users sword has been flagged with Red.")
	else
		print(player.Names.."'s equipped sword seems alright! Regular sword size")
	end
end

ReachEvent.onServerEvent:Connect(onReachRecieved)

I’m new to RemoteEvents, any help would be greatly appreciated.

Right now you have RegularSwordSize equal to a string. Try changing it to Vector3.new(1, 0.8, 4)

1 Like

I will change this, and I will post if any issues further occur. Please do tell me if you notice any other flaw.

This worked, it now doesn’t show a false positive, but now I’m encountering another issue. It appears that whenever I change the Sword Size with the Studio Client, and not through the server perspective, it just says I’m using the normal sword size, when I’m not. How would I fix this…?

NEVERMIND! I fixed the issue. Thanks for reading this if you did. If another issue occurs, I will post here. Thanks a ton! For now, your post is the solution!

if your curious what I did, I moved the SizeOfSword variable in the Activated function on the sword :wink:

1 Like