Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

1 comment

0

Thx ;D

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