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.
Don't use mytix, tix, ratio1, and ratio2 as arguments if you are already declaring them in the function.