Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Fire is not a valid member of RemoteEvent?

local event = game:GetService("ReplicatedStorage"):WaitForChild("died")

game:GetService('Players').PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		character:WaitForChild("Humanoid").Died:Connect(function()
			event:Fire(player)
		end)
	end)
end)

The remote event "died" is in the ReplicatedStorage.

This script is located in workspace.model

When I died, the message Fire is not a valid member of RemoteEvent "ReplicatedStorage.died" was displayed in the developer console

2 comments

0

:Fire() for RemoteEvents is actually :FireServer() and :FireClient() respectively.

0

FireServer can only be activated by local scripts and FireClient is for server -> client.

1 answer

Hello there.

There are three types of functions in remote events. These are FireServer(), FireClient(), and FireAllClients()

Use FireServer() when using client scripts (Client --> Server)

Use FireClient() or FireAllClients() when using server scripts (Server --> Client)

I hope this helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.