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

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

Asked by 5 years ago
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

Log in to vote
0
Answered by
xJigoku 17
5 years ago

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

0
thanks soumaila12345 0 — 5y
Ad

Answer this question