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

Argument Missing or nil? What does this mean??? I have tried searching up for this but im not sure.

-- Variables
local Startgame = game.ReplicatedStorage.EventHandler.StartGame

-- { Functions }
function TestSubject1()
	print("Hello Emily.")
end

-- Value Maker
game.Players.PlayerAdded:Connect(function(plr)
	local Bool = Instance.new("BoolValue")
	Bool.Value = false
	Bool.Name = "Playing"
	Bool.Parent = plr
end)

-- Check Playing
local trigger = false

for i, v in pairs(game.Players:GetPlayers()) do
  if v.ValueName.Value == true then
    trigger = true
  end
end

if not trigger then
	Startgame:FireClient()
end

The part hte error takes place is where it says Startgame:FireClient()

1 answer

The :FireClient() needs a player to fire it to. If you want to fire it to every player, use :FireAllClients() instead Otherwise, you have to do this :FireClient({player})

For more information read this: https://developer.roblox.com/en-us/api-reference/class/RemoteEvent

3 comments

0

How would i get the player though? its underlined red

0

What is your goal? What script does something with the fire? As it is named StartGame I would think that it's something to do with telling the players or teleporting them

0

If you intend to send a signal to another script, not localscript, you need to use a BindableEvent instead.

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