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: OnTouched function

Previous Thread :: Next Thread 
20wavecaps is not online. 20wavecaps
Joined: 28 Jan 2011
Total Posts: 6220
04 Jan 2014 01:35 AM
What did I do wrong here

script.Parent.Touched:connect(function(hit)
q = game.Players:FindFirstChild(hit.Parent.Name)
a = script.Parent.Parent.GUI.SurfaceGui.PlayerName.Text
wait(0.1)
a = "---Scanning---"
wait(0.5)
a = "--Scanning--"
wait(0.5)
a = "-Scanning-"
wait(0.5)
a = "Scanning"
wait(0.5)
a = "Complete"
wait(0.5)
a = q

end)



[2WC / ND]
Report Abuse
20wavecaps is not online. 20wavecaps
Joined: 28 Jan 2011
Total Posts: 6220
04 Jan 2014 01:37 AM
output isnt giving any bad feedback

[2WC / ND]
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
04 Jan 2014 01:38 AM
Don't you need a tag at the end?
Report Abuse
20wavecaps is not online. 20wavecaps
Joined: 28 Jan 2011
Total Posts: 6220
04 Jan 2014 01:39 AM
no

[2WC / ND]
Report Abuse
20wavecaps is not online. 20wavecaps
Joined: 28 Jan 2011
Total Posts: 6220
04 Jan 2014 01:40 AM
I dont think so atleast. Last time I used that very same opening I didnt need one.

[2WC / ND]
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
04 Jan 2014 01:41 AM
script.Parent.Touched:connect(function(hit)
if hit.Parent and hit.Parent:findFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
a = script.Parent.Parent.GUI.SurfaceGui.PlayerName.Text
for i = 5, 0,-1 do
a.Text = (string.rep("-", i).."Scanning"..string.rep("-", i))
wait(.1)
end
wait(0.5)
a.Text = "Complete"
end
end
end)
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
04 Jan 2014 01:42 AM
*




local db = true
script.Parent.Touched:connect(function(hit)
if hit.Parent and hit.Parent:findFirstChild("Humanoid") and db then
db = false
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
a = script.Parent.Parent.GUI.SurfaceGui.PlayerName.Text
for i = 5, 0,-1 do
a.Text = (string.rep("-", i).."Scanning"..string.rep("-", i))
wait(.1)
end
wait(0.5)
a.Text = "Complete"
db = true
end
end
end)
Report Abuse
20wavecaps is not online. 20wavecaps
Joined: 28 Jan 2011
Total Posts: 6220
04 Jan 2014 01:49 AM
Still does not work

[2WC / ND]
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
04 Jan 2014 01:50 AM
Output..?
Report Abuse
20wavecaps is not online. 20wavecaps
Joined: 28 Jan 2011
Total Posts: 6220
04 Jan 2014 01:51 AM
"01:51:33.153 - local db = true
script.Parent.Touched:connect(function(hit):2: attempt to index global 'script' (a nil value)"

Thats all im getting

[2WC / ND]
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
04 Jan 2014 01:57 AM
http://www.roblox.com/scanner-item?id=141071579
Report Abuse
Skythee is not online. Skythee
Joined: 07 Jul 2013
Total Posts: 28
04 Jan 2014 02:03 AM
Ting = false
script.Parent.Touched:connect(function(hit)
char = hit.Parent:FindFirstChild('Humanoid')
if not char then return end
q = game.Players:GetPlayerFromCharacter(hit.Parent)
if not q then return end
if Ting == false then
Ting = true
a = script.Parent.Parent.GUI.SurfaceGui.PlayerName
wait(0.1)
a.Text = "---Scanning---"
wait(0.5)
a.Text = "--Scanning--"
wait(0.5)
a.Text = "-Scanning-"
wait(0.5)
a.Text = "Scanning"
wait(0.5)
a.Text = "Complete"
wait(0.5)
a.Text = q
Ting = false
end

end)
Report Abuse
20wavecaps is not online. 20wavecaps
Joined: 28 Jan 2011
Total Posts: 6220
04 Jan 2014 02:05 AM
thanks for the model Azarth, but the brick you touch is different than the brick with the GUI. I suppose I can try to convert it though.

[2WC / ND]
Report Abuse
20wavecaps is not online. 20wavecaps
Joined: 28 Jan 2011
Total Posts: 6220
04 Jan 2014 02:07 AM
Skythee's fix worked but im trying to get the name of the player to appear after it says complete.

[2WC / ND]
Report Abuse
Skythee is not online. Skythee
Joined: 07 Jul 2013
Total Posts: 28
04 Jan 2014 02:11 AM
a.Text = q.Name
Report Abuse
20wavecaps is not online. 20wavecaps
Joined: 28 Jan 2011
Total Posts: 6220
04 Jan 2014 02:13 AM
it works, thanks for all the help guys

[2WC / ND]
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