Trying to show textlabel to all players

local rainbow = {
	Color3.fromRGB(254, 0, 0);
	Color3.fromRGB(255, 127, 0);
	Color3.fromRGB(225, 221, 1);
	Color3.fromRGB(0, 200, 0);
	Color3.fromRGB(0, 160, 199);
	Color3.fromRGB(0, 55, 230);
	Color3.fromRGB(129, 16, 210);
}

local info = TweenInfo.new(0.2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
script.Parent.TextLabel.TextColor3 = rainbow[1]

local name = script.Parent:FindFirstChildWhichIsA("String Value").Value
script.Parent.TextLabel.Text = name

local i = 1

while true do
	local tween = game:GetService("TweenService"):Create(script.Parent.TextLabel, info, {TextColor3 = rainbow[i]})
	tween:Play()
	repeat wait() until tween.Completed
	wait(0.1)
	if i == #rainbow then i = 1 else i = i + 1
	end	
end
local marketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local rainbowTitleId = 14284899
local balloonId = 14284908
local segwayId = 14284911
local vipId = 14284920

function UserOwnsGamePassAsync(PlayerID,GamePass)
	local Success,Results = pcall(function()
		return marketPlaceService:UserOwnsGamePassAsync(PlayerID,GamePass)
	end)
	print(Success,Results)
	if Success and Results then
		return true
	end
end

Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if UserOwnsGamePassAsync(player.UserId,rainbowTitleId) then
			local clone =  ReplicatedStorage:WaitForChild("OverheadGui"):Clone()
			clone.Parent = character:WaitForChild("Head")
			
			local name = Instance.new("StringValue", clone)
			name.Name = "PlayerName"
			name.Value = player.Name
		end
		if UserOwnsGamePassAsync(player.UserId, balloonId) then
			ReplicatedStorage:WaitForChild("GreenBalloon"):Clone().Parent = player:WaitForChild("Backpack")
			ReplicatedStorage:WaitForChild("GreenBalloon"):Clone().Parent = player:WaitForChild("StarterGear")
		end
		if UserOwnsGamePassAsync(player.UserId, segwayId) then
			ReplicatedStorage:WaitForChild("Segway"):Clone().Parent = player:WaitForChild("Backpack")
			ReplicatedStorage:WaitForChild("Segway"):Clone().Parent = player:WaitForChild("StarterGear")
		end
	end)
end)
  1. the text thingy
  2. the cloning script

this is right yeh?

just do:

for i, v in pairs(game:GetService("Players"):GetPlayers()) do

wait, WHY DID I NOT THINK OF THAT

Yes that’s perfect!! The one thing I just realized is I would change this line:

local name = script.Parent:FindFirstChildWhichIsA("String Value").Value

and replace with:

local name = script.Parent.PlayerName.Value

wait, forget what I just said, it is not to ALL players via a local, you are trying to make a name tag.

god i hope this really hope this works

1 Like

works with just me so far, now to try with 2 players. please work

1 Like

its not just showed name, that is a start. waiting for friend to join hopeing it will work. if it doesnt i will be very sad

:crossed_fingers:, you can also just make a test server by going to test at the top and click on 2 player server. That way you can test by yourself.

Just put the script in starterplayerscripts, then you can reference the path to the text label instead of script.Parent

nope, test server shows no gui at all

IT WORKS! IT ACTUALLY WORKS! thank you so much dude

Lets gooooooo! So glad it works :slight_smile: .

1 Like

that took me literally 4 hours of debugging

Wow, that must have been frustrating. I’m glad I could help.