I know there are some ways like:
for _,plr in pairs(game.Players:GetPlayers()) do
end
--------------------------------
local plr = game:GetService("Players").LocalPlayer -- Never works.
Need it for this script.
local VIP = require(script.Parent);
local debounce = false;
local market = game:GetService("MarketplaceService");
local ID = VIP.infromation.vipID;
VIP.infromation.obj.portal.Touched:Connect(function(hit)
local player = nil;-- What do I put here>
if market:UserOwnsGamePassAsync(player.UserId,ID) then
if not debounce then debounce = true
if hit.Parent.Character ~= nil then
hit.Parent.Character:moveTo(VIP.infromation.obj.enter.front)
wait(1)
debounce = false
end
end
end
end)

5 comments
use :GetPlayerFromCharacter()
I changed local player = nil; to local player = hit.Parent:GetPlayerFromCharacter() but it does not work.
You use GetPlayerFromCharacter on the Players service and place the character inside of the parenthesis.
It would have to be an if conditional statement if you wanted that. Is this script in a part? Then “if hit.Parent:FindFirstChild("Humanoid") then”
No you still need to reference game.Players for it to work