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
EVALDOL
(catstealer83)
#2
The brackets () is used when calling a function. So the Text property accepts âstringâ only. You canât call a string!
1 Like
EVALDOL
(catstealer83)
#3
Were you trying to change the text of clone.Tag?
If so, type clone.Tag.Text = âDirectorâ, just like you wrote below.
Find4U2Go
(LiterallyNoOne)
#4
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)
EVALDOL
(catstealer83)
#5
(There is no such variable as Director, type âDirectorâ instead)
Edit: fixed.
1 Like