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
 

Anything wrong with this script?

Previous Thread :: Next Thread 
Quna is not online. Quna
Joined: 15 Jan 2011
Total Posts: 538
20 Jun 2012 07:43 AM
I have a vip door to my place. However, the door only works ONCE, and then it just ignores me afterwards...?

asset = 84054778

script.Parent.Touched:connect(function(hit)
player = game.Players:getPlayerFromCharacter(hit.Parent)
if game:GetService('BadgeService'):UserHasBadge(player.userId, asset) then
script.Parent.CanCollide = false
script.Parent.Transparency = .6
wait(5)
script.Parent.CanCollide = true
script.Parent.Transparency = 0
else
hit.Parent:BreakJoints()
end
end)
Report Abuse
superninja42 is not online. superninja42
Joined: 29 Dec 2009
Total Posts: 61
20 Jun 2012 07:51 AM
Ok I know Whats Wrong Wait A Second And I will script you a new one.
Report Abuse
superninja42 is not online. superninja42
Joined: 29 Dec 2009
Total Posts: 61
20 Jun 2012 07:58 AM
Ok Heres My Script I Made in 2010 :)

--Script Made By Superninja42 -- 2010
print ("VIP Shirt Door Script Loaded")

permission = {"YOURNAMEHERE"}

texture = "http://www.roblox.com/Item.aspx?ID=84054778"

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)
print("Door Hit")
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
if human.Parent.Torso.roblox.Texture == texture then --the shirt
Door.Transparency = 0.7
Door.CanCollide = false
wait(4) -- this is how long the door is open
Door.CanCollide = true
Door.Transparency = 0
-- a human has touched this door!
print("Human touched door")
-- test the human's name against the permission list
elseif (checkOkToLetIn(human.Parent.Name)) then
print("Human passed test")
Door.Transparency = 0.7
Door.CanCollide = false
wait(2) -- this is how long the door is open
Door.CanCollide = true
Door.Transparency = 0
else human.Health = 0 -- delete this line of you want a non-killing VIP door
end
end
end

script.Parent.Touched:connect(onTouched)

Report Abuse
Quna is not online. Quna
Joined: 15 Jan 2011
Total Posts: 538
20 Jun 2012 07:59 AM
Thanks alot, but do you have to wear the t-shirt to make it work?
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
20 Jun 2012 08:00 AM
Yup.
Report Abuse
Quna is not online. Quna
Joined: 15 Jan 2011
Total Posts: 538
20 Jun 2012 08:06 AM
Hmm, doesnt really work tho :/
Report Abuse
superninja42 is not online. superninja42
Joined: 29 Dec 2009
Total Posts: 61
20 Jun 2012 08:12 AM
Are you putting the shirts id on the doors script,
Tell me the shirt and i will get its ID.
Report Abuse
superninja42 is not online. superninja42
Joined: 29 Dec 2009
Total Posts: 61
20 Jun 2012 08:15 AM
Ok I know Why let me Give me a sec
Report Abuse
superninja42 is not online. superninja42
Joined: 29 Dec 2009
Total Posts: 61
20 Jun 2012 08:18 AM
Ok Fixed It I Put The Wrong ID In




--Script Made By Superninja42 -- 2010
print ("VIP Shirt Door Script Loaded")

permission = {"YOURNAMEHERE"}

texture = "http://www.roblox.com/asset/?id=84054778"

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)
print("Door Hit")
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
if human.Parent.Torso.roblox.Texture == texture then --the shirt
Door.Transparency = 0.7
Door.CanCollide = false
wait(4) -- this is how long the door is open
Door.CanCollide = true
Door.Transparency = 0
-- a human has touched this door!
print("Human touched door")
-- test the human's name against the permission list
elseif (checkOkToLetIn(human.Parent.Name)) then
print("Human passed test")
Door.Transparency = 0.7
Door.CanCollide = false
wait(2) -- this is how long the door is open
Door.CanCollide = true
Door.Transparency = 0
else human.Health = 0 -- delete this line of you want a non-killing VIP door
end
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
20 Jun 2012 08:19 AM
Isn't the asset ID change in-game aswell?
Report Abuse
Quna is not online. Quna
Joined: 15 Jan 2011
Total Posts: 538
20 Jun 2012 09:14 AM
Still killing me :/
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