|
| 02 Jan 2016 07:35 PM |
local door = script.Parent local ServerStorage = game.ServerStorage
door.Touched:connect(function(hit) local guiclone = ServerStorage.ScreenGui:Clone() local backpack = hit.Parent:FindFirstChild('Backpack') guiclone.Parent = backpack end) |
|
|
| Report Abuse |
|
|
jmt99
|
  |
| Joined: 27 Jul 2008 |
| Total Posts: 4799 |
|
|
| 02 Jan 2016 07:37 PM |
I'm guessing the error is something like "Backpack is not a valid member of Model"?
#code --jmt99 |
|
|
| Report Abuse |
|
|
4ef
|
  |
| Joined: 27 May 2013 |
| Total Posts: 5633 |
|
|
| 02 Jan 2016 07:40 PM |
i think hit is a body part so its in character
#code print("4ef") |
|
|
| Report Abuse |
|
|
jmt99
|
  |
| Joined: 27 Jul 2008 |
| Total Posts: 4799 |
|
|
| 02 Jan 2016 07:41 PM |
^backpack isn't in the character
#code --jmt99 |
|
|
| Report Abuse |
|
|
jmt99
|
  |
| Joined: 27 Jul 2008 |
| Total Posts: 4799 |
|
|
| 02 Jan 2016 07:41 PM |
but yes hit is a body part
#code --jmt99 |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2016 07:42 PM |
| the output doesn't say anything the script just ins't executing! PLEASE HELP! |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2016 07:43 PM |
| So how would I write this? |
|
|
| Report Abuse |
|
|
jmt99
|
  |
| Joined: 27 Jul 2008 |
| Total Posts: 4799 |
|
|
| 02 Jan 2016 07:43 PM |
--try this
local door = script.Parent local ServerStorage = game.ServerStorage
local debounce = false door.Touched:connect(function(hit) --check if the hit was a player and decounce the event if (hit.Parent:FindFirstChild("Humanoid") and not debounce) then debounce = true local player = game.Players:GetPlayerFromCharacter(hit.Parent) local guiclone = ServerStorage.ScreenGui:Clone() local backpack = player:FindFirstChild('Backpack') guiclone.Parent = backpack debounce = false end end)
#code --jmt99 |
|
|
| Report Abuse |
|
|
| |
|
4ef
|
  |
| Joined: 27 May 2013 |
| Total Posts: 5633 |
|
|
| 02 Jan 2016 07:49 PM |
i dont really work with what youre trying to do here sorry i cant help
#code print("4ef") |
|
|
| Report Abuse |
|
|
jmt99
|
  |
| Joined: 27 Jul 2008 |
| Total Posts: 4799 |
|
|
| 02 Jan 2016 07:53 PM |
--try this
local door = script.Parent local ServerStorage = game.ServerStorage
local debounce = false door.Touched:connect(function(hit) --check if the hit was a player and decounce the event if (hit.Parent:FindFirstChild("Humanoid") and not debounce) then debounce = true local player = game.Players:GetPlayerFromCharacter(hit.Parent) local guiclone = ServerStorage.ScreenGui:Clone() local playergui = player:FindFirstChild('PlayerGui') guiclone.Parent = playergui debounce = false end end)
#code --jmt99 |
|
|
| Report Abuse |
|
|
oreoollie
|
  |
| Joined: 15 Mar 2013 |
| Total Posts: 16 |
|
|
| 02 Jan 2016 07:57 PM |
| Try running their code in the output window. Also, make sure that the script you're testing it in isn't disabled... |
|
|
| Report Abuse |
|
|
| |
|
jmt99
|
  |
| Joined: 27 Jul 2008 |
| Total Posts: 4799 |
|
|
| 02 Jan 2016 08:00 PM |
Please give me more information than that.
#code --jmt99 |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2016 08:02 PM |
| the output doesn't say anything. The code isn't executing. |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2016 08:03 PM |
| the script is under the door and the gui is in server storage. |
|
|
| Report Abuse |
|
|
jmt99
|
  |
| Joined: 27 Jul 2008 |
| Total Posts: 4799 |
|
|
| 02 Jan 2016 08:04 PM |
Try debugging it with prints then.
#code --jmt99 |
|
|
| Report Abuse |
|
|