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!
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!
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)
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.
*The first parameter will always be player
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
it needs the first parameter which is the player to send it to
else it will return nil which will not know which player to fire it to and it gives an error