title, basically im trynna make a script where i connect the group to my game, and based on your rank in my group, you get an overhead tag. This script is inside a screengui in ReplicatedStorage.
script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChatService = require(game.ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
local overheadGui = script.NameTag
local groupId = 17172847
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local head = character.Head
local overheadGuiClone = overheadGui:Clone()
local Success,Result = pcall(function()
return player:GetRankInGroup(groupId)
end)
local humanoid = character.Humanoid
humanoid.DisplayDistanceType = "None"
overheadGuiClone.Parent = head
overheadGuiClone.Adornee = head
overheadGuiClone.PlayerName.Text = player.Name
if Success then -- here
if Result >= 254 then
overheadGuiClone.PlayerRank.Text = "Goofiest Of All Goobers"
spawn(function()
while task.wait() do
local t = 5;
local hue = tick() % t / t
local colorrr = Color3.fromHSV(hue, 1, 1)
overheadGuiClone.PlayerRank.TextColor3 = colorrr
end -- to here is making a rainbow color
end)
elseif Result == 253 then
overheadGuiClone.PlayerRank.Text = "Ultra Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(163, 0, 0)
elseif Result == 2 then
overheadGuiClone.PlayerRank.Text = "Mega Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(30, 226, 0)
elseif Result == 1 then
overheadGuiClone.PlayerRank.Text = "Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(0, 174, 255)
elseif Result == 0 then
overheadGuiClone.PlayerRank.Text = ""
end
end
end)
end)
did that, and got the error NameTag is not a valid member of LocalScript "Players.GammerAtomYT.PlayerScripts.overheadGui.LocalScript"
also heres what the script looks like so far:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChatService = game:GetService("Chat")
local overheadGui = script.NameTag
local groupId = 17172847
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local head = character.Head
local overheadGuiClone = overheadGui:Clone()
local Success,Result = pcall(function()
return player:GetRankInGroup(groupId)
end)
local humanoid = character.Humanoid
humanoid.DisplayDistanceType = "None"
overheadGuiClone.Parent = head
overheadGuiClone.Adornee = head
overheadGuiClone.PlayerName.Text = tostring(player.Name)
if Success then -- here
if Result >= 254 then
overheadGuiClone.PlayerRank.Text = "Goofiest Of All Goobers"
spawn(function()
while task.wait() do
local t = 5;
local hue = tick() % t / t
local colorrr = Color3.fromHSV(hue, 1, 1)
overheadGuiClone.PlayerRank.TextColor3 = colorrr
end -- to here is making a rainbow color
end)
elseif Result == 253 then
overheadGuiClone.PlayerRank.Text = "Ultra Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(163, 0, 0)
elseif Result == 2 then
overheadGuiClone.PlayerRank.Text = "Mega Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(30, 226, 0)
elseif Result == 1 then
overheadGuiClone.PlayerRank.Text = "Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(0, 174, 255)
elseif Result == 0 then
overheadGuiClone.PlayerRank.Text = ""
print(Result)
end
end
end)
end)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChatService = game:GetService("Chat")
local overheadGui = game.Players.LocalPlayer:WaitForChild("overheadGui")
local groupId = 17172847
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local head = character.Head
local overheadGuiClone = overheadGui:Clone()
local Success,Result = pcall(function()
return player:GetRankInGroup(groupId)
end)
local humanoid = character.Humanoid
humanoid.DisplayDistanceType = "None"
overheadGuiClone.Parent = head
overheadGuiClone.Adornee = head
overheadGuiClone.PlayerName.Text = tostring(player.Name)
if Success then -- here
if Result >= 254 then
overheadGuiClone.PlayerRank.Text = "Goofiest Of All Goobers"
spawn(function()
while task.wait() do
local t = 5;
local hue = tick() % t / t
local colorrr = Color3.fromHSV(hue, 1, 1)
overheadGuiClone.PlayerRank.TextColor3 = colorrr
end -- to here is making a rainbow color
end)
elseif Result == 253 then
overheadGuiClone.PlayerRank.Text = "Ultra Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(163, 0, 0)
elseif Result == 2 then
overheadGuiClone.PlayerRank.Text = "Mega Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(30, 226, 0)
elseif Result == 1 then
overheadGuiClone.PlayerRank.Text = "Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(0, 174, 255)
elseif Result == 0 then
overheadGuiClone.PlayerRank.Text = ""
print(Result)
end
end
end)
end)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChatService = game:GetService("Chat")
local overheadGui = game.Players.LocalPlayer.PlayerGui:WaitForChild("overheadGui")
local groupId = 17172847
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local head = character.Head
local overheadGuiClone = overheadGui:Clone()
local Success,Result = pcall(function()
return player:GetRankInGroup(groupId)
end)
local humanoid = character.Humanoid
humanoid.DisplayDistanceType = "None"
overheadGuiClone.Parent = head
overheadGuiClone.Adornee = head
overheadGuiClone.PlayerName.Text = tostring(player.Name)
if Success then -- here
if Result >= 254 then
overheadGuiClone.PlayerRank.Text = "Goofiest Of All Goobers"
spawn(function()
while task.wait() do
local t = 5;
local hue = tick() % t / t
local colorrr = Color3.fromHSV(hue, 1, 1)
overheadGuiClone.PlayerRank.TextColor3 = colorrr
end -- to here is making a rainbow color
end)
elseif Result == 253 then
overheadGuiClone.PlayerRank.Text = "Ultra Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(163, 0, 0)
elseif Result == 2 then
overheadGuiClone.PlayerRank.Text = "Mega Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(30, 226, 0)
elseif Result == 1 then
overheadGuiClone.PlayerRank.Text = "Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(0, 174, 255)
elseif Result == 0 then
overheadGuiClone.PlayerRank.Text = ""
print(Result)
end
end
end)
end)
yes i put print(Result) in the script, and yet nothing appeared in output.
script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChatService = game:GetService("Chat")
local overheadGui = game:GetService("StarterGui"):WaitForChild("overheadGui")
local groupId = 17172847
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local head = character.Head
local overheadGuiClone = overheadGui:Clone()
local Success,Result = pcall(function()
return player:GetRankInGroup(groupId)
end)
local humanoid = character.Humanoid
humanoid.DisplayDistanceType = "None"
overheadGuiClone.Parent = head
overheadGuiClone.Adornee = head
overheadGuiClone.PlayerName.Text = tostring(player.Name)
if Success then -- here
if Result >= 254 then
overheadGuiClone.PlayerRank.Text = "Goofiest Of All Goobers"
spawn(function()
while task.wait() do
local t = 5;
local hue = tick() % t / t
local colorrr = Color3.fromHSV(hue, 1, 1)
overheadGuiClone.PlayerRank.TextColor3 = colorrr
end -- to here is making a rainbow color
end)
elseif Result == 253 then
overheadGuiClone.PlayerRank.Text = "Ultra Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(163, 0, 0)
elseif Result == 2 then
overheadGuiClone.PlayerRank.Text = "Mega Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(30, 226, 0)
elseif Result == 1 then
overheadGuiClone.PlayerRank.Text = "Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(0, 174, 255)
elseif Result == 0 then
overheadGuiClone.PlayerRank.Text = ""
print(Result)
end
end
end)
end)
You have put the print in wrong line, try this and lmk what did it print
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChatService = game:GetService("Chat")
local overheadGui = script.NameTag
local groupId = 17172847
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local head = character.Head
local overheadGuiClone = overheadGui:Clone()
local Success,Result = pcall(function()
return player:GetRankInGroup(groupId)
end)
local humanoid = character.Humanoid
humanoid.DisplayDistanceType = "None"
overheadGuiClone.Parent = head
overheadGuiClone.Adornee = head
overheadGuiClone.PlayerName.Text = tostring(player.Name)
if Success then -- here
print(Result)
if Result >= 254 then
overheadGuiClone.PlayerRank.Text = "Goofiest Of All Goobers"
spawn(function()
while task.wait() do
local t = 5;
local hue = tick() % t / t
local colorrr = Color3.fromHSV(hue, 1, 1)
overheadGuiClone.PlayerRank.TextColor3 = colorrr
end -- to here is making a rainbow color
end)
elseif Result == 253 then
overheadGuiClone.PlayerRank.Text = "Ultra Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(163, 0, 0)
elseif Result == 2 then
overheadGuiClone.PlayerRank.Text = "Mega Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(30, 226, 0)
elseif Result == 1 then
overheadGuiClone.PlayerRank.Text = "Goober"
overheadGuiClone.PlayerRank.TextColor3 = Color3.fromRGB(0, 174, 255)
elseif Result == 0 then
overheadGuiClone.PlayerRank.Text = ""
end
end
end)
end)