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

How do i fix the error i dont get it im trying to change its transparency?

local bot = 50 + 50

if bot == 100 then
	print("yes")
	function top(thor,czar)
			return thor + czar
   
	end
end
 variable2 = top(0.25,0.25)


game.Workspace.joey.Transparency =  top()

01:37:48.933 - soumaila12345's Place Number: 48 auto-recovery file was created yes 01:37:51.338 - Workspace.Script:6: attempt to perform arithmetic on local 'thor' (a nil value) 01:37:51.339 - Stack Begin 01:37:51.340 - Script 'Workspace.Script', Line 6 - global top 01:37:51.341 - Script 'Workspace.Script', Line 13 01:37:51.342 - Stack End

1 answer

The reason you are getting an error is because on line 13, you aren't giving any arguments so it would error when trying to return 'thor + czar'. To fix this change line 13 from: game.Workspace.joey.Transparency = top() To: game.Workspace.joey.Transparency = variable2

1 comment

0

thanks

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