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.
-- place this script into the server script service
local gps = game:GetService("GamePassService") local rf = game:GetService("ReplicatedStorage"):WaitForChild("gamepassChecker")
local function returnPassInfo(player, actual, passid) -- 'player' is the player of the client, not the speaker; 'actual' represents the player of the speaker if gps:PlayerHasPass(actual, passid) then return true else return false end end
rf.OnServerInvoke = returnPassInfo
for the rest it is really complicated this should help it has stuff that will work
https://www.roblox.com/library/1396880050/Chat-Title-System-2-6-18