Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

The parameter part is going red,error:expected 'Player' instance type ?

Asked by 2 years ago
Edited by Xapelize 2 years ago
local GetTimerRemote:RemoteFunction = game.replicatedstorage:Waitforchild("GetTimertext)
local Time:number?,Boosts:table<string>? = GetTimerRemote:InvokeClient(Player)

now the parameter, player is in red, so idk why that's happening

i got error Argument 1 is invalid: expected 'Player' instance type pls help

1 answer

Log in to vote
2
Answered by 2 years ago
Edited 2 years ago

When type-checking a table, don't just write colon then table. Instead, use it like this Table: {any}. Also I noticed you have typographical errors in your script.

local GetTimerRemote: RemoteFunction = game.ReplicatedStorage:WaitForChild("GetTimertext")
local Time: number?, Boosts: {string}? = GetTimerRemote:InvokeClient(Player)

Here's a tutorial for type-checking if you want.

Ad

Answer this question