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: why doesn't this work!

Previous Thread :: Next Thread 
swimmaster07 is not online. swimmaster07
Joined: 08 Jun 2013
Total Posts: 1459
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 is online. 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 is not online. 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 is online. 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 is online. 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
swimmaster07 is not online. swimmaster07
Joined: 08 Jun 2013
Total Posts: 1459
02 Jan 2016 07:42 PM
the output doesn't say anything the script just ins't executing! PLEASE HELP!
Report Abuse
swimmaster07 is not online. swimmaster07
Joined: 08 Jun 2013
Total Posts: 1459
02 Jan 2016 07:43 PM
So how would I write this?
Report Abuse
jmt99 is online. 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
swimmaster07 is not online. swimmaster07
Joined: 08 Jun 2013
Total Posts: 1459
02 Jan 2016 07:47 PM
still doesn't work...
Report Abuse
4ef is not online. 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 is online. 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 is not online. 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
swimmaster07 is not online. swimmaster07
Joined: 08 Jun 2013
Total Posts: 1459
02 Jan 2016 07:59 PM
nothing happenes...
Report Abuse
jmt99 is online. 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
swimmaster07 is not online. swimmaster07
Joined: 08 Jun 2013
Total Posts: 1459
02 Jan 2016 08:02 PM
the output doesn't say anything. The code isn't executing.
Report Abuse
swimmaster07 is not online. swimmaster07
Joined: 08 Jun 2013
Total Posts: 1459
02 Jan 2016 08:03 PM
the script is under the door and the gui is in server storage.
Report Abuse
jmt99 is online. jmt99
Joined: 27 Jul 2008
Total Posts: 4799
02 Jan 2016 08:04 PM
Try debugging it with prints then.


#code --jmt99
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