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 Hint Help

Previous Thread :: Next Thread 
DjBadyBoy is not online. DjBadyBoy
Joined: 01 Aug 2011
Total Posts: 681
20 Sep 2012 06:19 AM
script:

function onTouched()
M=Instance.new("Hint")
M.Text=..Player.Name"Has got to stage 1"
wait(2)
M:destroy()
end
script.Parent.Touched:connect(onTouched)

output:

Workspace.Part.Script:3: unexpected symbol near '..'


Thank You
Report Abuse
Sharpshooter26 is not online. Sharpshooter26
Joined: 26 May 2010
Total Posts: 5166
20 Sep 2012 06:21 AM
Missing" and I think you have to defind it's parent.
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
20 Sep 2012 06:21 AM
line 3

M.Text=..Player.Name"Has got to stage 1"

M.Text=..Player.Name = "Has got to stage 1"
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
20 Sep 2012 06:22 AM
Ah no wait,

M.Text= Player.Name.."Has got to stage 1"
Report Abuse
Sharpshooter26 is not online. Sharpshooter26
Joined: 26 May 2010
Total Posts: 5166
20 Sep 2012 06:22 AM
Oh he is adding the text, sorry looked over quickly
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
20 Sep 2012 06:23 AM
Triple post, woop!

You might even want to add a space in between the two strings otherwise they concatenate with no gap

M.Text= Player.Name.." ".."Has reached stage 1!"
Report Abuse
DjBadyBoy is not online. DjBadyBoy
Joined: 01 Aug 2011
Total Posts: 681
20 Sep 2012 06:24 AM
@RoflBread

output:

Workspace.Part.Script:3: attempt to index global 'Player' (a nil value)
Report Abuse
DjBadyBoy is not online. DjBadyBoy
Joined: 01 Aug 2011
Total Posts: 681
20 Sep 2012 06:25 AM
okay wait i'll try the third post u posted
Report Abuse
DjBadyBoy is not online. DjBadyBoy
Joined: 01 Aug 2011
Total Posts: 681
20 Sep 2012 06:25 AM
yeah...

output:

M.Text= Player.Name.." ".."Has reached stage 1!"
Report Abuse
DjBadyBoy is not online. DjBadyBoy
Joined: 01 Aug 2011
Total Posts: 681
20 Sep 2012 06:26 AM
i meant output:

Workspace.Part.Script:3: attempt to index global 'Player' (a nil value)

sorry
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
20 Sep 2012 06:29 AM
Though you had already defined the Player variable; no worries.


function onTouched(hit)
if hit.Parent.Humanoid then
M=Instance.new("Hint")
M.Text= hit.Parent.Parent.Name.." ".."Has got to stage 1"
wait(2)
M:destroy()
end
script.Parent.Touched:connect(onTouched)

output:
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
20 Sep 2012 09:21 AM
MAGAWD


function onTouched(hit)
if hit.Parent:findFirstChild("Humanoid) then
player = game.Players:GetPlayerFromCharacter(hit.Parent)
M=Instance.new("Hint", workspace)
M.Text= player.Name .." has got to stage 1"
wait(2)
M:Destroy()
end
end
script.Parent.Touched:connect(onTouched)

Report Abuse
DjBadyBoy is not online. DjBadyBoy
Joined: 01 Aug 2011
Total Posts: 681
20 Sep 2012 09:37 AM
@ thedeathmaster01

thank you very much
Report Abuse
corto713 is not online. corto713
Joined: 12 Dec 2009
Total Posts: 962
20 Sep 2012 12:09 PM
Not sure just threw this together...

function onTouched(hit)
m = Instance.new("Hint", Workspace)
h = hit.Parent
m.Text = (h.. "Has got to stage 1!")
wait(3)
m:Destroy()
end
script.Parent.Touched:connect(onTouched)
Report Abuse
Daelus is not online. Daelus
Joined: 06 Sep 2012
Total Posts: 144
20 Sep 2012 12:32 PM
I, as well, just threw this together, but I'm pretty confident of it.


h = Instance.new("Hint")

script.Parent.Touched:connect(function(hit)
if hit.Parent then
if game.Players:findFirstChild(hit.Parent.Name) then
h.Parent = game.Workspace
h.Text = hit.Parent.Name .. " has got to Stage 1!"
wait(3)
h.Parent = nil
end
end
end)
Report Abuse
Xnite515 is not online. Xnite515
Joined: 18 Feb 2011
Total Posts: 22763
20 Sep 2012 02:55 PM
function onTouched()
if hit ~= nil then --check check for nil.
m = Instance.new("Hint", workspace)
m.Text=..hit.Name... "has got to stage 1"
wait(3)
m:Destroy()
end
script.Parent.Touched:connect(onTouched) --basic connection for basic ppls
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