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.