Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my player billboard GUI not working?

Asked by
6zk8 95
4 years ago
game.Players.PlayerAdded:Connect(function(p)

  local pname = tostring(p)
  local prank = p:GetRankInGroup(5795473)

  local body = game.Workspace:WaitForChild(pname)

  local head = body.Head
  local hum = body.Humanoid

  hum.HealthDisplayDistance = 0
  hum.NameDisplayDistance = 0

  local block = game.ReplicatedStorage.Text:Clone()
  local block2 = game.ReplicatedStorage.Text2:Clone()

  block.Parent = workspace
  block2.Parent = workspace

  block.Position = head.Position(Vector3.new(0, 1, 0))
  block2.Positon = head.Position(Vector3.new(0, 2, 0))

  block.BillBoardGui.TextLabel.Text = tostring(prank)
  block2.BillboardGui.TextLabel.Text = tostring(p)

end)

That is my regular script in the workspace.

Im getting the error Workspace.Script:20: attempt to call a userdata value

1 answer

Log in to vote
2
Answered by 4 years ago

Line 20 and 21 should be

block.Position = head.Position + Vector3.new(0, 1, 0)
block2.Positon = head.Position + Vector3.new(0, 2, 0)
Ad

Answer this question