generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Confusing Output

Previous Thread :: Next Thread 
TheNickmaster21 is not online. TheNickmaster21
Joined: 04 Oct 2008
Total Posts: 9490
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 is not online. 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
TheNickmaster21 is not online. TheNickmaster21
Joined: 04 Oct 2008
Total Posts: 9490
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
TheNickmaster21 is not online. TheNickmaster21
Joined: 04 Oct 2008
Total Posts: 9490
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 is not online. 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 is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
29 Dec 2014 10:55 AM
yeah latetoast
Report Abuse
TheNickmaster21 is not online. TheNickmaster21
Joined: 04 Oct 2008
Total Posts: 9490
29 Dec 2014 10:58 AM
Thanks for helping!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image