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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 24 Feb 2011 |
| Total Posts: 10297 |
|
|
| 16 Jan 2016 02:15 PM |
| yeah this is in a local script |
|
|
| Report Abuse |
|
|
kittyabs
|
  |
| Joined: 24 Feb 2011 |
| Total Posts: 10297 |
|
|
| 16 Jan 2016 02:15 PM |
| @pun everything i do is messy ok |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|