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 » Scripting Helpers
Home Search
 

Re: Variables?

Previous Thread :: Next Thread 
selena13524 is not online. selena13524
Joined: 18 Jan 2010
Total Posts: 260
04 May 2013 07:48 PM
function Click()
wait()
local Action = Workspace.HeadTurn
local ActionClone = Workspace.HeadTurn:Clone()
Clicker = script.Parent.Parent.Parent.Parent.Parent.Parent.Name
ActionClone.Parent = Workspace.Clicker
ActionClone.Disabled = false
ActionClone:Destroy()
end

script.Parent.MouseButton1Down:connect(Click)

The output says that Clicker is not a valid member of Workspace. So I guess variables don't work when just plainly Workspace.Clicker. Is there something I'd need to add so that the Name is what they read?
Report Abuse
justin2865 is not online. justin2865
Joined: 30 Dec 2011
Total Posts: 4677
04 May 2013 07:53 PM
Change name to clicker in properties.
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
04 May 2013 08:01 PM
Variables aren't stored in the workspace.
Report Abuse
USArockssoccer15 is not online. USArockssoccer15
Joined: 28 Jun 2010
Total Posts: 9719
04 May 2013 08:22 PM
script.Parent.Parent.Parent.Parent.Parent.Parent.Name = Clicker
Report Abuse
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
04 May 2013 08:25 PM
ActionClone.Parent = Workspace:FindFirstChild(Clicker)
Report Abuse
selena13524 is not online. selena13524
Joined: 18 Jan 2010
Total Posts: 260
04 May 2013 08:52 PM
Thanks to whoever tried to help.

function Click()
print('Clicked')
wait()
local Action = Workspace.HeadTurn
local ActionClone = Action:Clone()
Clicker = script.Parent.Parent.Parent.Parent.Parent.Parent.Name
ActionClone.Parent = Workspace:FindFirstChild(Clicker)
print('ParentChanged')
ActionClone.Disabled = false
ActionClone:Destroy()
print('End')
end

script.Parent.MouseButton1Down:connect(Click)

It still won't work even though the output says:

Clicked
ParentChanged
End

Anyone else have anything?
Report Abuse
selena13524 is not online. selena13524
Joined: 18 Jan 2010
Total Posts: 260
04 May 2013 10:05 PM
Will anyone please help? D:

I'm basically asking this:

How do I insert something into the player's model who clicked on the GUI button?

Workspace
>Player1

Players
>Player1
>PlayerGui
>ScreenGui
>Thing
>OtherThing
>Action
>Script

Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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