I have been trying to make a voting system, but I have one problem. When I try to find the player, it doesn't look for the Player's name (What is typed into the box named player) but it instead looks inside the textbox. Code is below:
local playname = script.Parent.Parent.Player.Text script.Parent.MouseButton1Down:connect(function() local value = game.Players:FindFirstChild(playname["leaderstats"]["ThumbsUp"].Value) value = value + 1 end
first off, it's Player.Name, not Player.Text. secondly, why in the world would you use FindFirstChild when you already have the player. just do local value = script.Parent.Parent.Parent.Player["leaderstats"]["ThumbsUp"].Value
or if it's in a LocalScript do game.Players.LocalPlayer
local playname = script.Parent.Parent.Player.Text script.Parent.MouseButton1Click:connect(function() local value = game.Players:FindFirstChild(playname).leaderstats.ThumbsUp.Value value = value + 1 end
Hope this helped if the problem persists, try testing it in player
Also if this is in the StarterGui make sure this is in a local script.