|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 25 Apr 2012 10:33 PM |
Thank you bunny!
~Basquetbol~ |
|
|
| Report Abuse |
|
|