Workspace.RankHandler:15: attempt to call a string value

Hey!

I am trying to make an overhead GUI, and I get this error.
Workspace.RankHandler:15: attempt to call a string value - Server - RankHandler:15
Code

local owner = "xxJohneyxx11" --Owner here

local clone = script.Overhead:Clone()
local groupid = 12904837

game.StarterPlayer.NameDisplayDistance = 0 
game.StarterPlayer.HealthDisplayDistance = 0 

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		clone.Username.Text = plr.Name
		clone.Role.Text = plr:GetRoleInGroup(groupid)
	
		if plr.Name == owner then
	clone.Tag.Text("Director")

			clone.Role.Text = plr.team.name
clone.Role.TextColor = plr.TeamColor
	
		end
		
		clone.Parent = char:FindFirstChild("Head")
	end)
end)
1 Like

The brackets () is used when calling a function. So the Text property accepts ‘string’ only. You can’t call a string!

1 Like

Were you trying to change the text of clone.Tag?
If so, type clone.Tag.Text = “Director”, just like you wrote below.

Based of @EVALDOL’s suggestion at the post above, try changing the code to:

local owner = "xxJohneyxx11" --Owner here

local clone = script.Overhead:Clone()
local groupid = 12904837

game.StarterPlayer.NameDisplayDistance = 0 
game.StarterPlayer.HealthDisplayDistance = 0 

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		clone.Username.Text = plr.Name
		clone.Role.Text = plr:GetRoleInGroup(groupid)
	
		if plr.Name == owner then
	clone.Tag.Text = "Director"

			clone.Role.Text = plr.team.name
clone.Role.TextColor = plr.TeamColor
	
		end
		
		clone.Parent = char:FindFirstChild("Head")
	end)
end)

(There is no such variable as Director, type “Director” instead)
Edit: fixed.

1 Like