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:
01 | local billboardgui = game:GetService( "ServerStorage" ):WaitForChild( "BillboardGui" ) |
02 | game.Players.PlayerAdded:Connect( function (player) |
03 | player.CharacterAdded:Connect( function (char) |
04 |
05 |
06 | if player.Name = = "VIP" then |
07 | local clonedgui = billboardgui:Clone() |
08 | clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head |
09 | clonedgui.TextLabel.Text = "VIP" ..player.Name |
10 | clonedgui.TextLabel.TextColor 3 = Color 3. fromRGB( 239 , 184 , 56 ) |
11 | else |
12 | local clonedgui = billboardgui:Clone() |
13 | clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head |
14 | clonedgui.TextLabel.Text = " " ..player.Name |
15 | clonedgui.TextLabel.TextColor 3 = Color 3 ( 239 , 184 , 56 ) |
16 | end |
17 | end ) |
18 | 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:
01 | local groupID = 4010855 ; |
02 | local before_name = false ; |
03 | local ts = tostring |
04 | game.Players.PlayerAdded:connect( function (player) |
05 | repeat wait() until player.Character |
06 | local char = player.Character |
07 | getRole(player) |
08 | player.Changed:connect( function () |
09 | repeat wait() until player.Character |
10 | wait() |
11 | getRole(player) |
12 | end ) |
13 | end ) |
14 | function createTitle(p, s) |
15 | local gui = script.Title |
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