Argument 1 missing or nil

I`m quite new to remote events, I ran into this problem that I do not know how to fix

Server:

local is_touched = game:GetService("ReplicatedStorage")
local thing = is_touched:WaitForChild("Checks'tthyteamofthee")



script.Parent.Touched:Connect(function(hit)
	
	
	if hit.Parent:FindFirstChild("Torso") then
	      thing:FireClient(print("l"))
	end
		
		
	
end)

Client:

local is_touched = game:GetService("ReplicatedStorage")
local thing = is_touched:WaitForChild("Checks'tthyteamofthee")


local function checksteam()
	local team = game.Players.LocalPlayer
	local playes = game.Teams
	
	if team.Team == playes.Red then
		print("try")
	end
	end

thing.OnClientEvent:Connect(checksteam)

Could you describe what you’re trying to accomplish at a high level, and how your code here is supposed to do that? Also if you could mention which line had the error, it would help greatly.

Line 10 had the error,
I waned it so when you touch a brick it checks your team, if your on red team it prints try

you want to identify the player you’re firing the client to. if you want to fire to everyone, use FireAllClients()

script.Parent.Touched:Connect(function(hit)
	local hit2 = hit.Parent:FindFirstChild("Humanoid")--humanoid is a better option
	
	if hit2 then 
local player = game:GetService("Players"):GetPlayerFromCharacter(hit2.Parent) --get player from char
	      thing:FireClient(player, print("l"))
	end

end)
1 Like

Thank you, It works. I just tried it now :slight_smile:

1 Like