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

[SOLVED] Why isn't the BillboardGUI going into Roblox Premium subscribers?

Script Output:

ServerScriptService.Script:7: attempt to index nil with 'MembershipType

**Script: **

local overhead = game:GetService("ServerStorage"):WaitForChild("OverheadGUI");
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local plr = player.Character
local clonedgui = overhead:Clone();
local clonedTextL = clonedgui.ImageLabel;
 
if player.MembershipType == Enum.MembershipType.Premium then
	clonedgui.Parent = game.Workspace:WaitForChild(plr.Name).Head;
 
end


The script is in ServerScriptService.

1 comment

0

Not sure why the Codeblock created an extra line after LINE 01.

1 answer

✓ Accepted answer

Why is there a local script in ServerScriptService. I tested with the membership thing and it worked for me, but assuming from your player variable, you are cloning on the client. This means that the ui is being sent on the client. If you are using a server script, then LocalPlayer is invalid. A correction to this is:

local overhead = game:GetService("ServerStorage"):WaitForChild("OverheadGUI")
local clonedgui = overhead:Clone()
local clonedTextL = clonedgui.ImageLabel

game.Players.PlayerAdded:Connect(function(player)
	wait()
		if player.MembershipType == Enum.MembershipType.Premium then
			clonedgui.Parent = workspace:WaitForChild(player.Name).Head 
	end
end)

please make sure that the above script is in a server script. Please accept if it works for you!

1 comment

0

The script works when the player joins, but when they die or get re spawned, the BillboardGUI disappears.

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