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: I know I didn't do this right, help?

Previous Thread :: Next Thread 
Basquetbol is not online. Basquetbol
Joined: 09 Apr 2012
Total Posts: 819
25 Apr 2012 10:16 PM
function onTouch(Part)
x = game.Workspace.Winners
x = script.Parent:findFirstChild("Humanoid")
Bas = Instance.new("Message")
Bas.Text = "Winner is!"..x.Winners.Touched --This line needs to be fixed
wait(3)
Bas:remove()
end
script.Parent.Touched:connect(onTouch)


Like when someone touches the brick I want it to say "Winner is (Name)"

So, please give me info of how to to this?
~Basquetbol~
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
25 Apr 2012 10:29 PM
function onTouch(Part)
local x = game.Players:GetPlayerFromCharacter(Part.Parent)
if x then
local Bas = Instance.new("Message",Workspace)
Bas.Text = "Winner is "..x.Name.."!"
wait(3)
Bas:remove()
end
end
script.Parent.Touched:connect(onTouch)
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
25 Apr 2012 10:30 PM
Use this one instead.

script.Parent.Touched:connect(function(Part)
local x = game.Players:GetPlayerFromCharacter(Part.Parent)
if x then
local Bas = Instance.new("Message",Workspace)
Bas.Text = "Winner is "..x.Name.."!"
wait(3)
Bas:Destroy()
end
end
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
25 Apr 2012 10:31 PM
script.Parent.Touched:connect(function(Part)
if Part.Parent:FindFirstChild("Humanoid") then
Bas = Instance.new("Message",workspace)
Bas.Text = "Winner is: "..Part.Parent.Name.."!"
wait(3)
Bas:remove()
end
end)

Just to let you know this script has low quality in terms of professionalism.
Report Abuse
Basquetbol is not online. Basquetbol
Joined: 09 Apr 2012
Total Posts: 819
25 Apr 2012 10:32 PM
Output

20:31:53 - Workspace.Minigame script:3: unexpected symbol near '-'
20:31:54 - Workspace.Winner.Script:10: ')' expected (to close '(' at line 1) near '<​eof>'

~Basquetbol~
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
25 Apr 2012 10:32 PM
Ugh, I need to refresh my mind; I haven't coded in a while.
Report Abuse
Basquetbol is not online. Basquetbol
Joined: 09 Apr 2012
Total Posts: 819
25 Apr 2012 10:33 PM
Thank you bunny!

~Basquetbol~
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