|
| 29 Dec 2014 10:45 AM |
function activeChoice( isIt ) Choice = isIt script.Parent.Info.Visible = not isIt script.Parent.Info.Visible = isIt end
script.Parent.PickBarn.Event:connect( function( Barn ) activeChoice( ( Barn ~= nil ) )--Line 27 end)
Players.Player.PlayerGui.ToolGui.BarnInfo.ControlScript:27: attempt to call global 'activeChoice' (a boolean value)
Any idea what the issue is? |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 29 Dec 2014 10:49 AM |
o.e that activechoice function is very weird you're setting an unused variable, and the same property twice? but i don't think there's anything wrong with the code alone here |
|
|
| Report Abuse |
|
|
|
| 29 Dec 2014 10:51 AM |
Here's all the code:
CatalogModule = require(game.ReplicatedStorage.CatalogModule) local Player = game.Players.LocalPlayer local Active = false local Choice = false
function activeChoice( isIt ) Choice = isIt script.Parent.Choice.Visible = not isIt script.Parent.Info.Visible = isIt end
script.Parent:WaitForChild("ToggleEvent").Event:connect(function(isActive) Active = isActive activeChoice = false if( Active )then script.Parent:TweenPosition(UDim2.new(0, 0, 0.5, -100), "Out", "Quad", .75, true) else script.Parent:TweenPosition(UDim2.new(0, -205, 0.5, -100), "Out", "Quad", .75, true) end end)
script.Parent.Choice:WaitForChild("AcceptButton").MouseButton1Click:connect(function() script.Parent.AcceptBarn:Fire() end)
script.Parent.PickBarn.Event:connect( function( Barn ) activeChoice( ( Barn ~= nil ) ) end)
You did catch a mistake; thanks :P
Still gives the same error... |
|
|
| Report Abuse |
|
|
|
| 29 Dec 2014 10:53 AM |
| Figured it out. I set a global variable inside another function with the same name as the function. Whoops. |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 29 Dec 2014 10:54 AM |
because you set it to a boolean value...
activeChoice = false
what are you trying to achieve here? |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
| |
|
| |
|