|
| 21 Jan 2013 07:59 PM |
--Built and scripted by tuxedoman23
local text = script.Parent.Parent.Name --Model name db = true --Debounce variable
function onTouched(part) --Touched event
if db then --Debounce db = false
local name = part.Parent.Name text = "Hello there,"..name.."!" --Sentence with player name
db = true end --Ends if statement
end --Ends function
script.Parent.Touched:connect(onTouched) --Connection line
I did not get any output, by the way. |
|
|
| Report Abuse |
|
|
noah
|
  |
| Joined: 11 Sep 2006 |
| Total Posts: 18977 |
|
|
| 21 Jan 2013 08:20 PM |
local text = script.Parent.Parent.Name db = true
function onTouched(part) if db == true then db = false player = game.Players:GetPlayerFromCharacter(part.Parent) if player then text = "Hello there, "..player.Name.."!" db = true end end end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2013 08:22 PM |
"if db == true then" is the same as "if db then" |
|
|
| Report Abuse |
|
|
noah
|
  |
| Joined: 11 Sep 2006 |
| Total Posts: 18977 |
|
|
| 21 Jan 2013 08:26 PM |
| ik, but it just makes me feel better :3 |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2013 09:37 PM |
Still would not work?
local text = script.Parent.Parent.Name db = true
function onTouched(part)
if db == true then --Debounce db = false
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if player then text = "Hello there, "..player.Name.."!" --Sentence with player name db = true
end --Ends if statement with debounce end --Ends if statement with player end --Ends function
script.Parent.Touched:connect(onTouched)--Connection line |
|
|
| Report Abuse |
|
|
Luc599345
|
  |
| Joined: 25 Jul 2008 |
| Total Posts: 1169 |
|
|
| 21 Jan 2013 09:44 PM |
local text = script.Parent.Parent db = true
function onTouched(part)
if db == true then --Debounce db = false
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if player then text.Name = "Hello there, "..player.Name.."!" --Sentence with player name text.Text=text.Name wait(2) db = true
end --Ends if statement with debounce end --Ends if statement with player end --Ends function
script.Parent.Touched:connect(onTouched)--Connection line
~ Far over, the misty mountain colds... ~ |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2013 09:51 PM |
That still does not work, but I found the error. Thanks for your help anyways guys.
local text = script.Parent.Parent db = true
function onTouched(part)
if db == true then --Debounce db = false
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if player then text.Name = "Hello there, "..player.Character.Name.."!" --Sentence with player name text.Text=text.Name wait(2) db = true
end --Ends if statement with debounce end --Ends if statement with player end --Ends function
script.Parent.Touched:connect(onTouched)--Connection line |
|
|
| Report Abuse |
|
|
Luc599345
|
  |
| Joined: 25 Jul 2008 |
| Total Posts: 1169 |
|
|
| 21 Jan 2013 09:54 PM |
player.Character.Name is the same as player.Name...
~ Far over, the misty mountain colds... ~ |
|
|
| Report Abuse |
|
|