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: Tweening

Previous Thread :: Next Thread 
lilblitz56 is not online. lilblitz56
Joined: 06 Nov 2010
Total Posts: 461
10 May 2015 09:16 PM
I made a ClickDetector Part that when you click, is supposed to move a gui onto the screen. I've done it multiple times and it usually works, but for some reason this script doesn't do anything when you click it. Here's the script:

script.Parent.ClickDetector.MouseClick:connect(function(click)
local v = game.Players:FindFirstChild(click.Name)
local main = v.PlayerGui.Pets.Main
if main then
main:TweenPosition(UDim2.new(0.5,0,0.5,0),"In","Bounce",2,true)
end
end)
Report Abuse
EncodedLua is not online. EncodedLua
Joined: 02 May 2012
Total Posts: 1555
10 May 2015 09:20 PM
"main" doesn't look like it would return as a boolean... You should try "local main = v.PlayerGui.Pets:FindFirstChild("Main")"
Report Abuse
lilblitz56 is not online. lilblitz56
Joined: 06 Nov 2010
Total Posts: 461
10 May 2015 09:23 PM
I changed it to this:

script.Parent.ClickDetector.MouseClick:connect(function(click)
local v = game.Players:FindFirstChild(click.Name)
local main = v.PlayerGui.Pets:FindFirstChild("Main")
if main.Visible == true then
main:TweenPosition(UDim2.new(0.5,0,0.5,0),"In","Bounce",2,true)
end
end)


There's no error, yet it does nothing.
Report Abuse
EncodedLua is not online. EncodedLua
Joined: 02 May 2012
Total Posts: 1555
10 May 2015 09:24 PM
What is main exactly? Like what is the Class Name?
Report Abuse
lilblitz56 is not online. lilblitz56
Joined: 06 Nov 2010
Total Posts: 461
10 May 2015 09:25 PM
Pets = ScreenGui, Main = Frame
Report Abuse
lilblitz56 is not online. lilblitz56
Joined: 06 Nov 2010
Total Posts: 461
10 May 2015 09:32 PM
I tried printing some stuff in the script but nothing prints when I click it... Nut yet there's no error :/

script.Parent.ClickDetector.MouseClick:connect(function(click)
local v = game.Players:FindFirstChild(click.Name)
print(click.Name)
local main = v.PlayerGui.Pets:FindFirstChild("Main")
print(main.Parent.Name)
if main.Visible == true then
main:TweenPosition(UDim2.new(0.5,0,0.5,0),"In","Bounce",2,true)
end
end)
Report Abuse
lilblitz56 is not online. lilblitz56
Joined: 06 Nov 2010
Total Posts: 461
10 May 2015 09:49 PM
Nvm fixed it :P
Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
10 May 2015 09:51 PM
Uhh you know with click detectors you don't need to find the player...

script.Parent.ClickDetector.MouseClick:connect(function(player)--Already there for you..
end)
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