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: String manipulation script not working

Previous Thread :: Next Thread 
tuxedoman23 is not online. tuxedoman23
Joined: 24 Apr 2009
Total Posts: 4670
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 is not online. 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
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
21 Jan 2013 08:22 PM
"if db == true then"
is the same as
"if db then"
Report Abuse
noah is not online. 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
tuxedoman23 is not online. tuxedoman23
Joined: 24 Apr 2009
Total Posts: 4670
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 is not online. 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
tuxedoman23 is not online. tuxedoman23
Joined: 24 Apr 2009
Total Posts: 4670
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 is not online. 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
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