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: LocalScript in Hopperbin

Previous Thread :: Next Thread 
ZizZazZuz is not online. 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 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
25 Jan 2012 01:02 PM
*cough*

script.Parent.Selected:connect(onSelected)

Report Abuse
1waffle1 is not online. 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 is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
25 Jan 2012 01:38 PM
Really?
Report Abuse
mikeyman10ash is not online. mikeyman10ash
Joined: 29 Aug 2010
Total Posts: 30299
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 is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
25 Jan 2012 01:42 PM
Hey.
Report Abuse
1waffle1 is not online. 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 is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
25 Jan 2012 02:52 PM
Regular scripts don't work in Backpack.
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