Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Error : 22:21:36.254 - ServerScriptService.Main:65: attempt to call a Instance value?

Error : 22:21:36.254 - ServerScriptService.Main:65: attempt to call a Instance value I was sitting for a long time trying to get it to work right now i am trying to get MapName from the UI by taking the first table dictionary and find it by going to the UI map that won and take the actual map name in MapName but i ran into a error any help?.

https://imgur.com/a/Fos7uOo

  local MapVotes = {}

		for i,v in pairs(game.ReplicatedStorage.Assets.Values.MapVotes:GetChildren()) do
		MapVotes[v.Name] = {v.Value}
	end
	
	table.sort(MapVotes, function(a,b)
	return (a.Value > b.Value)
	end)
	
  --[[*Error Here *]] game.ReplicatedStorage.Assets.UI.MapWon.Map.MapName.Text = game.ReplicatedStorage.Assets.MapVote(tostring(MapVotes[1])).MapName.Text

3 comments

0

Do you have a child of MapName named Text?

0

cuz if you do then it would refer to that

0

no it's empty

1 answer

✓ Accepted answer

Why are you trying to call MapVote like a function? It appears to be an instance, yet you are calling it like a function.

MapVote(tostring(MapVotes[1]))

You could try doing this:

 game.ReplicatedStorage.Assets.UI.MapWon.Map.MapName.Text = game.ReplicatedStorage.Assets.MapVote:FindFirstChild(tostring(MapVotes[1])).MapName.Text

1 comment

0

Hm, I should have tried that. Thank you.

This discussion is preserved as it was. New answers, comments, and votes are closed.