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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

VIP Badge Confusion

Previous Thread :: Next Thread 
icanxlr8 is not online. icanxlr8
Joined: 25 Feb 2009
Total Posts: 3686
12 Jan 2013 02:10 PM
When someone touches my VIP door and is accepted in through a T-Shirt, it is supposed to award them a badge. For some reason, it isn't working right. If you see an error, please tell me. [NOTE: I tested this in gameplay on my alt, and it didn't recieve the badge.]

function onTouched(hit)
LPlayer = game.Players:FindFirstChild(hit.Parent.Name)
local h = hit.Parent:findFirstChild("Humanoid")
if (h ~= nil ) then
if h.Parent.Torso.roblox.Texture == texture then Door.Transparency = 1
Door.CanCollide = false
wait(1) Door.CanCollide = true
Door.Transparency = 0
game:GetService("BadgeService"):AwardBadge(LPlayer.userId, 103343303)
Report Abuse
icanxlr8 is not online. icanxlr8
Joined: 25 Feb 2009
Total Posts: 3686
12 Jan 2013 02:11 PM
[By the way, I just cut this out. There is more to the script, like ends and stuff.]
Report Abuse
Sethalonian is online. Sethalonian
Joined: 13 Jan 2010
Total Posts: 530
12 Jan 2013 02:20 PM
Well, it'l be hard to tell unless we see the whole script XD
Report Abuse
icanxlr8 is not online. icanxlr8
Joined: 25 Feb 2009
Total Posts: 3686
12 Jan 2013 02:26 PM
This is the only part that doesn't work, but okay.
permission = { "icanxlr8","ipod30","buster242","ninjask23" } -- This is how
texture = "http://www.roblox.com/asset/?id=65224545"
function checkOkToLetIn(name)
for i = 1,#permission do
if (string.upper(name) == string.upper(permission[i])) then return true end
end
return false
end

local Door = script.Parent

function onTouched(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
if human.Parent.Torso.roblox.Texture == texture thenDoor.Transparency = 0.7
Door.CanCollide = false
wait(1)
Door.CanCollide = true
Door.Transparency = 0
game:GetService("BadgeService"):AwardBadge(LPlayer.userId, 103342958)
elseif (checkOkToLetIn(human.Parent.Name)) then
Door.Transparency = 0.7
Door.CanCollide = false
wait(1)
Door.CanCollide = true
Door.Transparency = 0
elseif game:GetService("BadgeService"):UserHasBadge(LPlayer.userId , 103343303) then
Door.Transparency = 0.7
Door.CanCollide = false
wait(1)
Door.CanCollide = true
Door.Transparency = 0
else human.Health = 0
end
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
8SunTzu8 is not online. 8SunTzu8
Joined: 30 Sep 2011
Total Posts: 8199
12 Jan 2013 02:32 PM
texture thenDoor.Transparency = 0.7

texture then Door.Transparency = 0.7 --fixed

"If you want to become a Developer or Innovator for CSA, contact me."
Report Abuse
8SunTzu8 is not online. 8SunTzu8
Joined: 30 Sep 2011
Total Posts: 8199
12 Jan 2013 02:34 PM
You gave us two different scripts...

"If you want to become a Developer or Innovator for CSA, contact me."
Report Abuse
icanxlr8 is not online. icanxlr8
Joined: 25 Feb 2009
Total Posts: 3686
12 Jan 2013 02:35 PM
Let me say THIS: The door works fine. My only error is it doesn't award the badge. That's why I only put a sliver to start with.
Report Abuse
8SunTzu8 is not online. 8SunTzu8
Joined: 30 Sep 2011
Total Posts: 8199
12 Jan 2013 02:40 PM
The thing I fixed would actually make the script run...

I don't know anything about how badges are awarded, but if it was set up right, then it should be awarded.

"If you want to become a Developer or Innovator for CSA, contact me."
Report Abuse
icanxlr8 is not online. icanxlr8
Joined: 25 Feb 2009
Total Posts: 3686
12 Jan 2013 02:43 PM
It worked fine, I must've screwed that part up in transfer.
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