function onButtonClicked(mytix,tix,ratio1,ratio2)
local player=script.Parent
local mytix=player.TixT.Text.Value
local tix=player.TixB.Text.Value
local ratio1=player.TR.Text.Value
local ratio2=player.RR.Text.Value
local RT=player.Parent.ResultsT
player.Visible=false
RT.Visible=true
RT.CT.Text.Value=("Current Tix: "..mytix.."")
local robuxgained = tix/ratio2
RT.RP.Text.Value=("Rx Profit: "..robuxgained.."")
local totaltix = robuxgained*ratio1
RT.TT.Text.Value=("End Tix Result: "..totaltix.."")
local tixgained = totaltix-mytix
RT.TP.Text.Value=("Tix Profit: "..tixgained.."")
end
script.Parent.R.MouseButton1Click:connect(onButtonClicked)
OutPut:17:57:38.430 - Players.Player1.PlayerGui.TC.ValuesTix.Script:12: attempt to concatenate local 'mytix' (a nil value) 17:57:38.431 - Stack Begin 17:57:38.431 - Script 'Players.Player1.PlayerGui.TC.ValuesTix.Script', Line 12 17:57:38.432 - Stack End
For some reason I keep getting this error.

2 comments
Well, i'm not sure if it matters, but could it be that you have mytix,tix,ratio1,ratio2 at the top? Even though they were defined? I havn't dealt with that part of Lua yet.
Unfortunately your answers didn't help. Thank you for responding though.