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

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

Asked by
TechModel 118
3 years ago
Edited 3 years ago

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

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

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)
Ad

Answer this question