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: Brick giving a gui

Previous Thread :: Next Thread 
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
27 Aug 2013 04:23 PM
This is my first block touching script in a really long time so don't judge XD

16:20:00.707 - Workspace.Base.Script:8: attempt to index global 'hit' (a nil value)
16:20:00.710 - Script 'Workspace.Base.Script', Line 8
16:20:00.710 - stack end
16:20:00.711 - Disconnected event because of exception
16:20:05.627 - PlayerGui is not a valid member of Part
16:20:05.627 - Script 'Workspace.Base.Script', Line 4
16:20:05.628 - stack end
16:20:05.628 - Disconnected event because of exception

That's the error output up there ^^^

script.Parent.Touched:connect(function(hit) --Does this call the block that was hit or what hit it?
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum then
hit.PlayerGui.Elevator.Frame.Visible = true
end
end)
script.Parent.TouchEnded:connect(function()
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum then
hit.PlayerGui.Elevator.Frame.Visible = false
end
end)
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
27 Aug 2013 04:35 PM
"hit" is the character, not the player..
~The Internet~
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
27 Aug 2013 04:39 PM
Oh... how do I connect a hit to the player instead :3
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
27 Aug 2013 04:40 PM
game.Players:GetPlayerFromCharacter(hit).Whatever

~The Internet~
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
27 Aug 2013 04:41 PM
Oops, I meant hit.Parent

~The Internet~
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
27 Aug 2013 04:43 PM
Ok thanks
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
27 Aug 2013 04:48 PM
Well actually Im getting a new error twice

16:47:13.478 - The function GetPlayerFromCharacter is not a member of "Model"
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
27 Aug 2013 04:51 PM
nevermind, I used a . instead of a :
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