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

invalid argument #3 (string expected, got RBXScriptConnection)?

Don't know the explanation behind this, but it's not updating the text when the value changes and sends a signal to update the text. The error is happening at "player.stats.Bank:GetPropertyChangedSignal("Value"):Connect(function()"

local player = game.Players.LocalPlayer

script.Parent.MouseEnter:Connect(function()
	
	script.Value.Value = true
	script.Parent.Text = player.stats.Bank:GetPropertyChangedSignal("Value"):Connect(function()
		
		abbreviateNums(player.stats.Bank)
	end)
end)

1 answer

✓ Accepted answer

script.Parent.Text = player.stats.Bank:GetPropertyChangedSignal("Value"):Connect(function() you can't set the Text of the TextLabel to an Event which is the GetPropertyChangedSignal.

FIXED SCRIPT

local player = game.Players.LocalPlayer

script.Parent.MouseEnter:Connect(function()

   script.Value.Value = true
   player.stats.Bank:GetPropertyChangedSignal("Value"):Connect(function()
        script.Parent.Text = player.stats.Bank.Value

        abbreviateNums(player.stats.Bank)
    end)
end)

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