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

How can I put in a userId on a server script?

Asked by 5 years ago

I am trying to add a "if" statement where when you if you have a gamepass, it gives you a overhead gui:

if game:GetService('MarketplaceService'):UserOwnsGamePassAsync(player, vipid) then
    vip.TextLabel.Text = player.Name .. " - VIP"
    local clonedgui3 = vip:Clone()
    clonedgui3.Parent = game.Workspace:WaitForChild(player.Name).Head
          end

What I need help with is how I can get the userid on a server side script

Im pretty new to lua so go easy on me plz :)

1 answer

Log in to vote
0
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
5 years ago

Like this?

if game:GetService('MarketplaceService'):UserOwnsGamePassAsync(player.UserId, vipid) then
    vip.TextLabel.Text = player.Name .. " - VIP"
    local clonedgui3 = vip:Clone()
    clonedgui3.Parent = game.Workspace:WaitForChild(player.Name).Head
end

just add .UserId to player on the first line

0
Thx ;D Carvizal 25 — 5y
Ad

Answer this question