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 error, why is it happening?

I wrote this script, as an attempt to make one of my AI's chat, when clicked. I used a remote function to make it client sided, instead of serversided, and I keep getting an error from the click script saying 'Argument 1 missing or nil' Here's the script:

script.Parent.MouseClick:Connect(function(player)
	if player:WaitForChild("PlayerGui").StoreGUI.Enabled == true then
		player.PlayerGui.StoreGUI.Enabled = false
	else
		script.Speak:FireClient()
		wait(8)
		player.PlayerGui.StoreGUI.Enabled = true
	end
end)

1 answer

You are doing script.Speak:FireClient() without specifying which client.

Do script.Speak:FireClient(player)

2 comments

0

Thanks. I'll try it.

0

Sorry for a delayed response. If it works, I'll accept it.

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