FireClinet event not working

idk, heres the script im using

local Event = game.ReplicatedStorage.NotifFolder["Server-Local Notifs"]

game.Players.PlayerAdded:Connect(function(a)
	a.Chatted:Connect(function(b)
		if b == "fart" then
			Event:FireClient(a, "Head", "Body", "no")
			print("sdffsdfdfs")
		end
	end)
end)

I have prints on the other script, and they dont fire.

I have a print here and that fires fine.

Also yes, i did wait for the event to exist, this is a diffrent version of the script without that.

Wait,ensure that the event is a remote event

And also print ur b

4 Likes

yeah i named it “server-local notifs” so i knew its a remote event.
If i was doing :FireClient and it was a bindable event, it would throw an error
But like i said there are no errors

2 Likes

also no need to print b, i know the command works, (it prints) but i cant get the event to fire

1 Like

Is b even equal to the condition you set

1 Like

huh??? wdym by that im confused

1 Like

this should work show the other script

also you have to say “fart” in the chat for the condition to work

1 Like

i know i do, when i say it in chat the print works.
Heres the bit of the other script reciving the event:

Server.OnClientEvent:Connect(function(HeadText, BodyText, ButtonOn)
	print("Recived")
	local ButOn = nil
	string.lower(ButtonOn)
	if ButtonOn == "yes" then
		ButOn = true
	elseif	ButtonOn == "no" then
		ButOn = false
	end
	AddToQue(HeadText, BodyText, ButOn)
end)

The print does not print, it should though

Bruh,is literally this scirpt that has problem

Where is your player??? In the parameter???

1 Like

why do i need a player in the param???

1 Like

U print the first parameter(“HeadText”) in your client script

And if it gives a player name or userid.u need to add the player as the first parameter

1 Like

im so confused you are not making any sense

1 Like

yeah no, like i said the first print is not printing, you know what that means? that means adding another print wont do anything

can u define server???

i think u didnt define your server(the varaibale)

i fr think im actually having a stroke i cant do this no more

sometimes roblox doesnt catch the event for PlayerAdded so sometimes you need to loop through all the players afterwards to catch them in studio.

local Players = game:GetService("Players")
local Event = game.ReplicatedStorage.NotifFolder["Server-Local Notifs"]

local function playerJoined(a)
	a.Chatted:Connect(function(b)
		if b == "fart" then
			Event:FireClient(a, "Head", "Body", "no")
			print("sdffsdfdfs")
		end
	end)
end

Players.PlayerAdded:Connect( playerJoined )
for _, player in Players:GetPlayers() do
	playerJoined(player)
end
1 Like

need to resay this again???
The print… prints
It prints properly, no issue at all, the event does not get fired tho

This is OnClientEvent, not OnServerEvent. The player is not the first parameter here

1 Like

apologies :fearful:
i was looking for anyone else who mentioned something similar to me
i skimmed it which is poor practice.

ah ok, any other way you could help?
sorry if i came off rude, just kinda mad about this