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

Add two values and display them in a surfacegui textbox. why not work?

Asked by 6 years ago

a player uploading their points (cash) to a display board, then their points are reset to 0

textbox = game.Workspace.displayscreen.SurfaceGui.Frame.TextBox.Text.Value

script.Parent.Touched:connect (function(hit)


local humanoid = hit.Parent:FindFirstChild("Humanoid")
    if humanoid then
    local playervalue = game.Players.LocalPlayer.leaderstats.Cash.Value

    textbox =  playervalue + tonumber(textbox)
    game.Players.LocalPlayer.leaderstats.Cash.Value = 0


    wait()
    end

end)

1 answer

Log in to vote
0
Answered by
Elixcore 1337 Moderation Voter
6 years ago

The problem is at line 1: "TextBox.Text.Value"

Remove ".Value"

Ad

Answer this question