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 » Scripters
Home Search
 

Please Help!

Previous Thread :: Next Thread 
mytouch is not online. mytouch
Joined: 31 Oct 2010
Total Posts: 83
04 Dec 2014 05:26 PM
I have a script where once a player touches a block it displays a message to everybody saying that "a player has won!" How would i make it so that it would say that it would say the actual player name instead of "a player"?
Report Abuse
mytouch is not online. mytouch
Joined: 31 Oct 2010
Total Posts: 83
04 Dec 2014 06:04 PM
bump
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
04 Dec 2014 06:08 PM
function onTouch(hit)
if hit and hit.Parent and game.Players:GetPlayerFromCharacter(hit.Parent) then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local msg = Instance.new("Message", workspace)
msg.Text = player.Name .. " has won!"
wait(5)
msg:Destroy()
end
end

script.Parent.Touched:connect(onTouch)

goes in block
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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