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

argument 1 is missing or nil.....why should i add an argument ?

server-sided script in serverscriptservice.... this should fire the remote event when the numbervalue (points) is changed but it gives an "argument 1 is missing or nil" error in line 5

points = game:GetService("ServerStorage"):WaitForChild("points")
event = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")

points.Changed:Connect(function()
	event:FireClient()
end)

when it fires the event this local script should change the text of the text label to be = the value of the points

event = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
points = game:GetService("ServerStorage"):WaitForChild("points")

event.OnClientEvent:Connect(function()
	script.Parent.TextLabel.Text = points.Value
end)

1 answer

✓ Accepted answer

The problem is your server script.

The server need to know which client to fire the event to, so you'll need to add a client as an argument.

event:FireClient(game.Players.Doobb_yyus) -- example

If you don't have a specific player to fire it to and want to fire it to all clients, use FireAllClients.

event:FireAllClients()

1 comment

0

ok thanks ^^

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