So I was making a Overhead Gui for Roblox Premium Players
and i watched alvinblox’s overhead gui tutorial and edit the code with the Premium Payouts and an error happened
Error: ServerScriptService.PremiumPlayers:4: attempt to index nil with ‘MembershipType’
local Players = game:GetService("Players")
local player = Players.LocalPlayer
if player.MembershipType == Enum.MembershipType.Premium then
local billboardgui = game:GetService("ServerStorage"):WaitForChild("BillboardGui")
game.Players.PlayerAdded:Connect(function(player)
local clonedgui = billboardgui:Clone()
clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head
clonedgui.TextLabel.Text = "Premium"
clonedgui.TextLabel.TextColor3 = Color3.fromRGB(231,206,12)
end)
end