Why is this underlined with orange

My code is underlined with orange but there’s nothing wrong with it

Here is my code

-- local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")

local Remotes = ReplicatedStorage.Remotes
local PlayerData = require(ServerScriptService.PlayerData.Manager)

local function Click(players: Player)
	PlayerData.AdjustClicks(player, 1)
end

Remotes.Click.OnServerEvent:Connect(Click)

Here is it in images

Please reply on how to fix this issue

4 Likes

Player is not a variable, but players is so you need to delete the s on the one in parameters.

2 Likes

capitlize player

2 Likes

In both screenahots you’ve defined the argument as players, but are trying to use the variable player.

2 Likes

delete players : try to do that

also you posted this same exact thing

2 Likes

So do I use the word Players Not Player

2 Likes
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")

local Remotes = ReplicatedStorage.Remotes
local PlayerData = require(ServerScriptService.PlayerData.Manager)

local function Click(player) -- It said players and not player. So that caused it to error. Also there is no need to add a :Player because player will always be a player no matter what.
	PlayerData.AdjustClicks(player, 1)
end

Remotes.Click.OnServerEvent:Connect(Click)
1 Like
-- local ReplicatedStorage = game:GetService("ReplicatedStorage")

remove the comments… this bugs line 4 for remotes which may prevent it from runninag

1 Like

You need to match the keyword in the function definition and where you use it in the function. For example:

local function Click(player: Player)
   PlayerData.AdjustClicks(player, 1)
end
1 Like

How about this why does it have a error

1 Like

Same as above. You mentioned players rather than player here
image

1 Like