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

Argument 1 missing or nil on Line 3?

It says Argument 1 missing or nil on Line 3?

game.ReplicatedStorage.Messages.OnServerEvent:Connect(function(player)
	player.leaderstats.Time.Value = player.leaderstats.Time.Value - 100
	game.ReplicatedStorage.Messaged:FireClient()
end)

Thanks!

2 answers

it is because in :FireClient you have to have an argument of which player to fire it to like this

game.Replicated.Messaged:FireClient(player)

2 comments

0

it needs the first parameter which is the player to send it to

0

else it will return nil which will not know which player to fire it to and it gives an error

When you are using RemoteEvents, the fire parameter will always be the Player who fired it. In this instance, it would be like so.

game.ReplicatedStorage.Messaged:FireClient(Player, AnyOtherThingYouWantToPass) -- The first parameter will always be the Player who fired it.

1 comment

0

*The first parameter will always be player

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