Fire client not working

so im making a marking system where when you hit a player with an attack it places a mark above their head, I want it to be where only the attacker can see the marks so I’m using FireClient but for some reason it won’t even work, it’s not even saying anything in the output.

Server side

game.ReplicatedStorage.AbilityEvent:FireClient(plr, hit, "mark")

Client side

game.ReplicatedStorage.AbilityEvent.OnClientEvent:Connect(function(plr, hit, Argument)
	print("Sent")
	if Argument == "mark" then
		print("Marked")
		if hit.Parent.Head:FindFirstChild("StringMarkers") then
			local children = hit.Parent.Head:FindFirstChild("StringMarkers"):GetChildren()
			local count = #children
			if count < 4 then
				local marker = game.ReplicatedStorage["PuppetMaster Files"].Marker:Clone()
				marker.Parent = hit.Parent.Head.StringMarkers
			end
		else
			local markers = game.ReplicatedStorage["PuppetMaster Files"].StringMarkers:Clone()
			markers.Parent = hit.Parent.Head
			local marker = game.ReplicatedStorage["PuppetMaster Files"].Marker:Clone()
			marker.Parent = hit.Parent.Head.StringMarkers
		end
	end
end)
2 Likes

probably not reading the event, do a variable to find it


make sure to use this on both scripts

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AbilityEvent = ReplicatedStorage:WaitForChild("AbilityEvent")

so I got it to send but it won’t add the mark
Server

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AbilityEvent = ReplicatedStorage:WaitForChild("AbilityEvent")
game.ReplicatedStorage.AbilityEvent:FireClient(plr, hit, "mark")

Client

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AbilityEvent = ReplicatedStorage:WaitForChild("AbilityEvent")

game.ReplicatedStorage.AbilityEvent.OnClientEvent:Connect(function(plr, hit, Argument)
	print("Sent")
	if Argument == "mark" then
		print("Marked")
		if hit.Parent.Head:FindFirstChild("StringMarkers") then
			local children = hit.Parent.Head:FindFirstChild("StringMarkers"):GetChildren()
			local count = #children
			if count < 4 then
				local marker = game.ReplicatedStorage["PuppetMaster Files"].Marker:Clone()
				marker.Parent = hit.Parent.Head.StringMarkers
			end
		else
			local markers = game.ReplicatedStorage["PuppetMaster Files"].StringMarkers:Clone()
			markers.Parent = hit.Parent.Head
			local marker = game.ReplicatedStorage["PuppetMaster Files"].Marker:Clone()
			marker.Parent = hit.Parent.Head.StringMarkers
		end
	end
end)

Output
“Sent - Client”

the “Argument” doesn’t work for some reason

1 Like

This might sound outright crazy but print your Argument variable and see what it returns before your if Argument and utilize tostring() for your argument, this may or may not work. Roblox can be odd sometimes.

it prints nil. I don’t think the send script actually sends anything for it.

the player doesnt get passed as a argument

game.ReplicatedStorage.AbilityEvent.OnClientEvent:Connect(function(hit, Argument)

1 Like

thank you this works perfectly.

1 Like

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