Event not firing

Hey! I’m trying to fire this event whenever someone interacts with a proximity prompt and enable the prompt only for the player that used it, but doesn’t fire the event, and as I’m new to using events I’m very lost, can anyone help? I don’t get a single error, and the script works as normal, but the event doesn’t fire…

the server script;

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ProxPrompt = script.Parent
local itemTemplate = script.Item
local Till = game.Workspace.GasStation.Shop.Till
local monitorScreen = Till.Monitor.Screen.SurfaceGui.Frame
local RE = ReplicatedStorage:WaitForChild("RemoteEvents")
local Event = RE:WaitForChild("TillProxPromt")
local checkoutPlayer = ""

ProxPrompt.Triggered:Connect(function(player)

checkoutPlayer = player.Name
ProxPrompt.Enabled = false
Event:FireClient(player)
print(player.Name)

(I’ve not included the rest of the script to avoid confusion as it’s not important to this question, but I can provide if needed)

the local script;

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RE = ReplicatedStorage:WaitForChild("RemoteEvents")
local Event = RE:WaitForChild("TillProxPromt")

Event.OnClientEvent:Connect(function(player)
	print(player.Name)
	script.Parent.Enabled = true
end)

Sorry if the answer is super simple, lol

FireClients is not a function, do you mean FireClient?

1 Like

FireClients doesn’t exist.
You have to use FireClient.
(or FireAllClients to fire all)

I completely forgot to correct the script before posting, it doesn’t work with FireClient either

does it throw any error? or it just doesn’t work

It doesn’t throw any errors, the script just continues without firing the event, or the local script doesn’t receive the event

Would it effect the RemoteEvent for it to be inside a folder inside ReplicatedStorage?

parent doesn’t matter, i put them inside scripts sometimes

ah, well I’m completely stumped

OnClientEvent doesnt take player as an argument, if u still want to print the player u should have to send it from server as a tuple
Server:

Event:FireClient(player,player)  --second argument for player

Client:

Event.OnClientEvent:Connect(function(player)
	print(player.Name)
	script.Parent.Enabled = true
end)

Found the issue! I’ve moved the script into StarterPlayerScripts. Thanks for all the replies :smile:

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