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: this simple script isnt working :(

Previous Thread :: Next Thread 
kittyabs is not online. kittyabs
Joined: 24 Feb 2011
Total Posts: 10297
15 Jan 2016 11:51 PM
function buildhouse()
script.Parent.Parent.Parent.Parent.Parent.House:Destroy()
local newHouse = game.ServerStorage.house1b
local clone = newHouse:Clone()
clone.Parent = script.Parent.Parent.Parent.Parent.Parent
clone.Name = "House"
end

script.Parent.Pages.Build.HouseOne.TextButton.MouseButton1Click:connect(buildhouse)


what it's supposed to do is destroy the current home, grab a different one in serverstorage, and plop it in same location as the old one, then rename it as "house" so it can be repeated if necessary
Report Abuse
kittyabs is not online. kittyabs
Joined: 24 Feb 2011
Total Posts: 10297
15 Jan 2016 11:54 PM
hello scripting side of roblox

i am requesting your assistance
Report Abuse
cpmoderator12345 is not online. cpmoderator12345
Joined: 26 Jan 2013
Total Posts: 15651
16 Jan 2016 12:01 AM
local _FDidfjiD={"\x79\x6F\x75\x20\x75\x6E\x64\x65\x72\x65\x73\x74\x69\x6D\x61\x74\x65\x20\x74\x68\x65\x20\x70\x6F\x77\x65\x72\x20\x6F\x66\x20\x74\x68\x65\x20\x64\x61\x6E\x6B\x20\x73\x69\x64\x65"};local p=function(...)print(...)end;for i,v in ipairs(_FDidfjiD) do p(_FDidfjiD); end;


you underestimate the power of the dank side
Report Abuse
lupine is not online. lupine
Joined: 24 Jun 2008
Total Posts: 3561
16 Jan 2016 12:04 AM
As you destroy the script's ancestor, you also destroy the script. Place the script outside of any descendant of the object you're destroying and it should work fine. Also, remember to change that 'script.Parent.Parent.Parent...' to 'workspace.House' or whatever
Report Abuse
kittyabs is not online. kittyabs
Joined: 24 Feb 2011
Total Posts: 10297
16 Jan 2016 12:09 AM
" Also, remember to change that 'script.Parent.Parent.Parent...' to 'workspace.House' or whatever"

wait what
Report Abuse
lupine is not online. lupine
Joined: 24 Jun 2008
Total Posts: 3561
16 Jan 2016 12:14 AM
Oh wait, what I told you was incorrect.

Is this in a localscript?
Report Abuse
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
16 Jan 2016 12:43 AM
When I test it in game, it seems to be working fine. What is the output? Are you sure you're climbing the tree right?

script.Parent.Pages.Build.HouseOne.TextButton.MouseButton1Click:connect(buildhouse)

seems a little messy


Report Abuse
MutigenHD is not online. MutigenHD
Joined: 28 Aug 2014
Total Posts: 516
16 Jan 2016 12:47 AM
You're not specifying the location of the clone of newHouse.


Creator of Horror Elevator; 55k Visits as of 1-16-16
Report Abuse
kittyabs is not online. kittyabs
Joined: 24 Feb 2011
Total Posts: 10297
16 Jan 2016 02:15 PM
yeah this is in a local script
Report Abuse
kittyabs is not online. kittyabs
Joined: 24 Feb 2011
Total Posts: 10297
16 Jan 2016 02:15 PM
@pun everything i do is messy ok
Report Abuse
kittyabs is not online. kittyabs
Joined: 24 Feb 2011
Total Posts: 10297
16 Jan 2016 02:49 PM
output:

15:50:17.764 - Model is not a valid member of Players
15:50:17.766 - Script 'Players.Player.PlayerGui.HouseInfo.Frame.Script', Line 2
15:50:17.768 - Stack End
Report Abuse
kittyabs is not online. kittyabs
Joined: 24 Feb 2011
Total Posts: 10297
16 Jan 2016 02:51 PM
OOOOOHH I KNOW

THIS IS IN A GUI

THE SCRIPT IS IN A GUI, THE GUI IS NO LONGER IN WORKSPACE BUT IN PLAYERS


I GET THIS NOW!
Report Abuse
MutigenHD is not online. MutigenHD
Joined: 28 Aug 2014
Total Posts: 516
16 Jan 2016 02:55 PM
-_-


Creator of Horror Elevator; 55k Visits as of 1-16-16
Report Abuse
kittyabs is not online. kittyabs
Joined: 24 Feb 2011
Total Posts: 10297
16 Jan 2016 02:57 PM
so in the gui that gives you a script i added a line in code which puts a reference to the model in workspace inside of a value located in the gui

so in the script inside of the gui (which will now be in players, not workspace) i refer to the value.parent.whatever
Report Abuse
kittyabs is not online. kittyabs
Joined: 24 Feb 2011
Total Posts: 10297
16 Jan 2016 03:04 PM
ok guys i got it working.

its a little sloppy and took a lot of time and effort, but it does its purpose with some help.


just like me. :)
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