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
|
  |
| 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 |
|
|
|
| 12 Jan 2013 02:20 PM |
| Well, it'l be hard to tell unless we see the whole script XD |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|