HayHay
1
I am working on a script, if a user owns a gamepass, it turns the GUI to rainbow or uses a player name, but the player name doesn’t work. The script:
local TweenService = game:GetService("TweenService")
local MarketPlaceService = game:GetService("MarketplaceService")
local VipPlayers = {"YourSnowingDev", "B00PUP"} -- Any person's name put here will get the gamepass for free
local gamePassId = 28000297 --REPLACE THIS WITH YOUR GAMEPASSID
local groupID = 12212248 --REPLACE THIS WITH YOUR GROUPID
local function FindPlayer(Plr)
for Num, Pler in pairs(VipPlayers) do
if Pler == Plr then
return true
end
end
end
game.Players.PlayerAdded:Connect(function(player)
local groupRank = player:GetRoleInGroup(groupID)
local clone = script.Rank:Clone()
clone.Parent = game.Workspace:WaitForChild(player.Name).Head
clone.Frame.Name1.Text = player.Name
clone.Frame.Rank.Text = groupRank
player.CharacterAdded:Connect(function()
local groupRank = player:GetRoleInGroup(groupID)
local clone = script.Rank:Clone()
clone.Parent = game.Workspace:WaitForChild(player.Name).Head
clone.Frame.Name1.Text = player.Name
clone.Frame.Rank.Text = groupRank
end)
player.CharacterAdded:Connect(function()
if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, gamePassId) or FindPlayer(player.Name) then
player.CharacterAdded:Connect(function(character)
while true do
local Rainbow = clone.Frame.Name1
local Color = Color3.new(math.random(), math.random(), math.random())
local ColorTween = TweenService:Create(Rainbow, TweenInfo.new(3), {TextColor3 = Color})
ColorTween:Play()
wait(3)
end
end)
end
end)
end)
Noah
2
Do you get any errors in the output?
HayHay
3
No, don’t think so. Lemme check.
Noah
6
Alright, what folder is this script in?
Noah
8
I just copied your code into my game:
local TweenService = game:GetService("TweenService")
local MarketPlaceService = game:GetService("MarketplaceService")
local VipPlayers = {"Cookie_DevX", "B00PUP"} -- Any person's name put here will get the gamepass for free
local gamePassId = 10525616 --REPLACE THIS WITH YOUR GAMEPASSID
local groupID = 10392184 --REPLACE THIS WITH YOUR GROUPID
local function FindPlayer(Plr)
for Num, Pler in pairs(VipPlayers) do
if Pler == Plr then
return true
end
end
end
game.Players.PlayerAdded:Connect(function(player)
local groupRank = player:GetRoleInGroup(groupID)
local clone = script.Rank:Clone()
clone.Parent = game.Workspace:WaitForChild(player.Name).Head
clone.Frame.Name1.Text = player.Name
clone.Frame.Rank.Text = groupRank
player.CharacterAdded:Connect(function()
local groupRank = player:GetRoleInGroup(groupID)
local clone = script.Rank:Clone()
clone.Parent = game.Workspace:WaitForChild(player.Name).Head
clone.Frame.Name1.Text = player.Name
clone.Frame.Rank.Text = groupRank
end)
player.CharacterAdded:Connect(function()
if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, gamePassId) or FindPlayer(player.Name) then
player.CharacterAdded:Connect(function(character)
while true do
local Rainbow = clone.Frame.Name1
local Color = Color3.new(math.random(), math.random(), math.random())
local ColorTween = TweenService:Create(Rainbow, TweenInfo.new(3), {TextColor3 = Color})
ColorTween:Play()
wait(3)
end
end)
end
end)
end)
This is what error I got:
Rank is not a valid member of Script "ServerScriptService.Script" - Server - Script:19
This means there was an error inside the script inside line 19.
When I check the line, I’ve seen that your cloning something, could you please send me a file of your model so I can test it for errors!
HayHay
9
HayHay
10
put it in serverscriptservice
1 Like
Noah
11
Ah, I see the issue, the tag isn’t rainbow, but it clones?
HayHay
12
Huh? I have no clue what that means… LOL.
Noah
13
But you wrote the script?
Remember on line: local clone = script.Rank:Clone()
Were you clone the script?
Noah
15
This should do the trick:
local TweenService = game:GetService("TweenService")
local MarketPlaceService = game:GetService("MarketplaceService")
local VipPlayers = {"Cookie_DevX", "B00PUP"} -- Any person's name put here will get the gamepass for free
local gamePassId = 10525616 --REPLACE THIS WITH YOUR GAMEPASSID
local groupID = 10392184 --REPLACE THIS WITH YOUR GROUPID
local function FindPlayer(Plr)
for Num, Pler in pairs(VipPlayers) do
if Pler == Plr then
return true
end
end
end
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, gamePassId) or FindPlayer(player.Name) then
local groupRank = player:GetRoleInGroup(groupID)
local clone = script.Rank:Clone()
clone.Parent = game.Workspace:WaitForChild(player.Name).Head
clone.Frame.Name1.Text = player.Name
clone.Frame.Rank.Text = groupRank
local groupRank = player:GetRoleInGroup(groupID)
local clone = script.Rank:Clone()
clone.Parent = game.Workspace:WaitForChild(player.Name).Head
clone.Frame.Name1.Text = player.Name
clone.Frame.Rank.Text = groupRank
while true do
local Rainbow = clone.Frame.Name1
local Color = Color3.new(math.random(), math.random(), math.random())
local ColorTween = TweenService:Create(Rainbow, TweenInfo.new(3), {TextColor3 = Color})
ColorTween:Play()
wait(3)
end
end
end)
end)
HayHay
16
HayHay
17
Thanks! I’ll test it out when roblox is back.
Noah
18
The issue is your using
CharacterAdded:Connect
Multiple times, this you were waiting for a character to be added, after its been added.
HayHay
19
Oof. Thank you! Will check it out when I can join a game. Look at the post I sent you please.
Noah
20
I tested it, this is the result you get:
HayHay
21
Thank you so much! I will test it when it lets me. LOL.