ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 25 Jan 2012 12:58 PM |
function onSelected(mouse) print'Selected' mouse.Button1Down:connect(function () print'clicked' part = mouse.Target if part.Parent:FindFirstChild("Humanoid") ~= nil or part.Parent.Parent:FindFirstChild("Humanoid") then print'Humanoid found' if game.Players:GetPlayerFromCharacter(part.Parent) ~= nil then print'passed' game:GetService("BadgeService"):AwardBadge(game.Players:GetPlayerFromCharacter(part.Parent).userId, 70871046) elseif game.Players:GetPlayerFromCharacter(part.Parent.Parent) then print'passed' game:GetService("BadgeService"):AwardBadge(game.Players:GetPlayerFromCharacter(part.Parent.Parent).userId, 70871046) end end end) end
script.Parent.Selected:connect(onSelected)
Is supposed to give the player I click a badge, but nothing happens, no output. |
|
|
| Report Abuse |
|
|
1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 25 Jan 2012 01:02 PM |
*cough*
script.Parent.Selected:connect(onSelected)
|
|
|
| Report Abuse |
|
|
1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 25 Jan 2012 01:02 PM |
| Nvm. I'm pretty sure LocalScripts can't award badges. |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
| |
|
|
| 25 Jan 2012 01:41 PM |
| Ohai ziz. I'm trying to learn scripting by observing forum scripts and figuring out what they do. |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
| |
|
1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 25 Jan 2012 01:56 PM |
Just use a regular script.
script.Parent.Selected:connect(function(mouse) mouse.Button1Down:connect(function() if mouse.Target then local player = game.Players:playerFromCharacter(mouse.Target.Parent) or game.Players:playerFromCharacter(mouse.Target.Parent.Parent) if player then game:GetService("BadgeService"):AwardBadge(player.userId, 70871046) end end end) end) |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 25 Jan 2012 02:52 PM |
| Regular scripts don't work in Backpack. |
|
|
| Report Abuse |
|
|