I have a script here but whenever I use a GUI for a gamepass I wanted it where the image button whenever its clicked they can buy the gamepass such as the
MarketPlaceService
getRole
IsInGroup
Yeah more like that...
Script 1:
local billboardgui = game:GetService("ServerStorage"):WaitForChild("BillboardGui")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
if player.Name == "VIP" then
local clonedgui = billboardgui:Clone()
clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head
clonedgui.TextLabel.Text = "VIP"..player.Name
clonedgui.TextLabel.TextColor3 = Color3.fromRGB(239, 184, 56)
else
local clonedgui = billboardgui:Clone()
clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head
clonedgui.TextLabel.Text = " "..player.Name
clonedgui.TextLabel.TextColor3 = Color3(239, 184, 56)
end
end)
end)
I wanted to have this script where when the person has the gamepass the VIP name is top of the rank name because I have another script here that I want where there is a group rank too!
Script 2:
local groupID = 4010855;
local before_name = false;
local ts = tostring
game.Players.PlayerAdded:connect(function(player)
repeat wait() until player.Character
local char = player.Character
getRole(player)
player.Changed:connect(function()
repeat wait() until player.Character
wait()
getRole(player)
end)
end)
function createTitle(p, s)
local gui = script.Title
local clone = gui:Clone()
clone.Parent = p.Character.Head
if before_name then
clone.F.T.Text = s.." "..p.Name
else
clone.F.T.Text = p.Name..", "..s
end
end
function getRole(player)
player.Character.Humanoid.NameOcclusion = "OccludeAll"
if player.Character.Head:findFirstChild("Title") then
return false
elseif not player.Character.Head:findFirstChild("Title") and player:IsInGroup(groupID) then
local rankString = player:GetRoleInGroup(groupID)
createTitle(player, rankString)
elseif not player:IsInGroup(groupID) then
createTitle(player "Guest")
end
end
Is there a way that these both scripts could combine together which hard to tell if it's a local script or normal script.
And as you know so far I don't know where to add the > MarketPlaceService in the first script but I also wanted these scripts where the person buys the gamepass and then when they rejoin there is a VIP name tag there and the group rank name tag too.
Here are some pictures I did what I am trying to do when a player to try to buy the gamepass.
Pictures
Picture 1: https://gyazo.com/f7c7c7c434e9bb8c81efa7d01baecbdd
Picture 2: https://gyazo.com/2c170ebaf2fce0676c6d10d6c113193b
So yeah I felt like this is too much but make sure you take your time.

1 comment
You should setup the gui all in one script amd the humanoid.