Spent the past 4 hours attempting to fix these errors

This has been occurring the past two days when applying updates to my game. I don’t fully recall how I had fixed it last time - so I just reverted it to the same spot. Which I’m quite certain is what I did in the first place that had “fixed it.” Even though it was essentially two shutdowns after the first - it was as if nothing had ever happened.

I tried to search for this on the devforum to see if anybody had any similar problems just to find nothing.

The furthest I got was noticing that it would kick you from the ToolsWeld script; which I was grateful to find out due to one of my testers being on standby.

After over 4 hours of attempting to fix this - I admit defeat. I honestly have no clue what else to do at this point.

ToolWelds Script:


local lastDone = {}
local tableInsert = table.insert

function Weld(x,y)
	local W = Instance.new("Weld")
	W.Part0 = x
	W.Part1 = y
	local CJ = CFrame.new(x.Position)
	local C0 = x.CFrame:inverse()*CJ
	local C1 = y.CFrame:inverse()*CJ
	W.C0 = C0
	W.C1 = C1
	W.Parent = x
end

function Get(A, handle)
	if handle then
		if A:IsA("BasePart") then
			Weld(handle, A)
			A.Anchored = false
		else
			local C = A:GetChildren()
			for i=1, #C do
			Get(C[i], handle)
			end
		end
	end
end


game.ReplicatedStorage.Events.ToolWelds.OnServerEvent:connect(function(player, gun, equipped, rCFrame, lCFrame)
	pcall(function()
		if not gun.Handle:FindFirstChild("Weld") then
			Get(gun, gun:FindFirstChild("Handle"))
		end
		if equipped then
			local arms = {player.Character:FindFirstChild("Right Arm"),player.Character:FindFirstChild("Left Arm")}
			if arms ~= nil then
				local m6d = {player.Character.Torso:FindFirstChild("Right Shoulder"),player.Character.Torso:FindFirstChild("Left Shoulder")}
				if not lCFrame then
					table.remove(m6d, 2)
				end
				if not rCFrame then
					table.remove(m6d, 1)
				end
				for _,v in pairs(m6d) do
					v.Part1 = nil
				end
				local weld
				local weld1
				if not player.Character:FindFirstChild("RWeld") then
					weld = Instance.new("Weld")
					weld.Part0 = player.Character.Head
					weld.Name = "RWeld"
					weld.Parent = player.Character
				else
					weld = player.Character:FindFirstChild("RWeld")
				end
				if rCFrame then
					weld.Part1 = arms[1]
					weld.C1 = rCFrame
				end
				if not player.Character:FindFirstChild("LWeld") then
					weld1 = Instance.new("Weld")
					weld1.Part0 = player.Character.Head
					weld1.Name = "LWeld"
					weld1.Parent = player.Character
				else
					weld1 = player.Character:FindFirstChild("LWeld")
				end 
				if lCFrame then
					weld1.Part1 = arms[2]
					weld1.C1 = lCFrame
				end
			end 
		else
			if player.Character then
				if player.Character:FindFirstChild("LWeld") then
					player.Character.LWeld.Part1 = nil
				end
				if player.Character:FindFirstChild("RWeld") then
					player.Character.RWeld.Part1 = nil
				end
				if player.Character:FindFirstChild("Torso") then
					if player.Character.Torso:FindFirstChild("Right Shoulder") and player.Character:FindFirstChild("Right Arm") then
						player.Character.Torso["Right Shoulder"].Part1 = player.Character["Right Arm"]
					end
					if player.Character.Torso:FindFirstChild("Left Shoulder") and player.Character:FindFirstChild("Left Arm") then
						player.Character.Torso["Left Shoulder"].Part1 = player.Character["Left Arm"]
					end
				end
			end
		end
	end)
end)

Can you elaborate what you want to achieve with the function Get()?
And there’s only 1 script while I see multiple errors. So can you please mark the errors from this script or show us the other scripts.

There are a bunch of errors and you seem to not understand any of them, so I’ll try to figure out what they all probably mean:

Image 1:

Saude is not a valid member of Model Workspace.Xuhann28

This doesn’t seem critical. A FindFirstChild and a return if it gives nothing will silence this. I have a feeling you didn’t even add this script?

Anchored is not a...

A script is attempting to treat a Script like a Part.

Image 2

Player:GetRankInGroup error: ...

The player whose rank in the group you’re getting is gone. I’m not sure what’s supposed to be making this error — something in a PlayerRemoving event? something else? — but if it’s the latter, it’s really clear cut, and if it’s the former, don’t use it on PlayerRemoving.

Image 4

CharacterAddedconnect

This is a dumb one. You missed a :. It’s supposed to be CharacterAdded:Connect

not a valid member of Folder "ServerStorage.Data"

These objects weren’t created when the players joined, so they won’t be there when the player leaves, either.

Image 5

Humanoid is not a valid member of Model "Workspace.Hat Remover"

This error is coming from the Hat Remover itself? The Hat Remover is trying to remove it’s own hats???

PlayerSpawned

There is no such event. Connect to CharacterAdded of each player. Usually this is done when the player joins the server (PlayerAdded).

game.Players.PlayerAdded:connect(function(player) 
	player.CharacterAdded:connect(function(character)
		-- ...
	end
end

Demotion Tool is not a valid member of ServerStorage

The tool you want your gamepass to copy just isn’t there.

This isn’t an exhaustive list of issues.

Also, the ToolWeld script doesn’t seem to be doing anything wrong. It has nothing in it that can Kick() a player.

1 Like

I appreciate the feedback and completely understand I’m inexperienced when it comes to these things. I was afraid I’d have to dig into the main gun’s script and mess with that anti-exploit system. Which frankly is quite useless.

I had just never noticed all of the other errors I suppose - I should really test run the game in a private server more frequently. And I’ve never had an issue with them giving off “false positives” before? Not sure why this is a thing now, but I got an idea on how to fix this now,

Further notice: I joined my server to run a test on the weapons via print commands I had implemented into the main script of the weapons approximately 10-15 minutes before you had responded. Overall over an hour - the server has been up.

Just to discover that the guns had begun working again?? Is this a ROBLOX bug? Possibly something on my end? Literally so confused.