Help wanted - arguement one missing or nil error

I get an Arguement one Missing or Nil error when I try to fire the Capture event.

local part = script.Parent
local siegetime = 5

local sieging = false

part.Touched:Connect(function(hit)
	local rs = game:GetService("ReplicatedStorage")
	local capture = rs.CaptureEvent
	
	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
	
	if sieging == true or part.BrickColor == plr.Team.TeamColor then 
		return 
	else
		sieging = true
		plr.Character:WaitForChild("Humanoid").WalkSpeed = 0
		for i = 1,5 do
			siegetime = siegetime-1
			print("Sieging " .. siegetime .. " seconds left.")
			if siegetime <= 0 then
				siegetime = 5
				print("Siege Concluded")
				part:SetAttribute("CurrentTileOwner",plr.Team.Name)
			end
			task.wait(1)
		end

		part.BrickColor = plr.Team.TeamColor
		sieging = false
		plr.Character:WaitForChild("Humanoid").WalkSpeed = 16
		capture:FireClient()
	end
	
end)

here’s the code, help is appreciated!

1 Like

The first parameter for FireClient must be a Player object.



If you want to fire all clients, put capture:FireAllClients().

Otherwise, you should be able to do capture:FireClient(plr) based on your current code.



(You also need to check if it’s a player that touched the part, you can do if not plr then return nil end after Players:GetPlayerFromCharacter(hit.Parent)).

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.