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: "return" not working?

Previous Thread :: Next Thread 
uglypoe is not online. uglypoe
Joined: 26 Mar 2011
Total Posts: 4382
14 Oct 2015 07:23 PM
The very bottom "return true" works, but the top and middle returns don't. What's wrong here?

function game.ReplicatedStorage.PokeMessage.OnClientInvoke(name)
local poke = game.ReplicatedStorage.CurrentData:InvokeServer(name)
if poke ~= 0 then
local area = script.Parent.MessageDisplayGui.HoldingFrame
script.Parent.Parent.Character.Torso.Anchored = true
area.MessageText.Text = "You seem to already have this pokemon\nWould you like to replace it with this new one?"
area.YesButton.Visible = true
area.NoButton.Visible = true
area.YesButton.MouseButton1Click:connect(function()
area.YesButton.Visible = false
area.NoButton.Visible = false
area.MessageText.Text = ""
script.Parent.Parent.Character.Torso.Anchored = false
return(true)
end)
area.NoButton.MouseButton1Click:connect(function()
area.YesButton.Visible = false
area.NoButton.Visible = false
area.MessageText.Text = ""
script.Parent.Parent.Character.Torso.Anchored = false
return(false)
end)
else
return(true)
end end

-- Praise RNGeezus --
Report Abuse
uglypoe is not online. uglypoe
Joined: 26 Mar 2011
Total Posts: 4382
14 Oct 2015 07:45 PM
Bumperino

-- Praise RNGeezus --
Report Abuse
uglypoe is not online. uglypoe
Joined: 26 Mar 2011
Total Posts: 4382
14 Oct 2015 07:56 PM
Only the last "return true" is returning True, the other two are returning Nil

-- Praise RNGeezus --
Report Abuse
uglypoe is not online. uglypoe
Joined: 26 Mar 2011
Total Posts: 4382
14 Oct 2015 08:07 PM
Nevermind, found the error myself. The middle and top return's were trying to return to the mousebutton1click functions instead of the OnClientInvoke function.

-- Praise RNGeezus --
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