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: What's wrong with this VIP Door script? It kills you when you touch it even though you have the T-Shirt on.

Previous Thread :: Next Thread 
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
09 Jul 2011 05:30 PM
print ("VIP T-Shirt Door Script Loaded")

-- list of account names allowed to go through the door.
permission = { "legend8887" } -- This is how many people can still get through, so u don't have to change shirts. You can also have another friend here.

-- TextureId of the VIP shirt.
texture = "http://www.roblox.com/Survive-Epic-Disasters-VIP-item?id=55800314" -- Go to the wiki below this script to find out how to change the shirt. And paste the link in between the "" marks.

function checkOkToLetIn(name)
for i = 1,#permission do
-- convert strings to all upper case, otherwise we will let in
-- "Username" but not "username" or "uSERNAME"
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(4) -- 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
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
09 Jul 2011 05:31 PM
texture = "http://www.roblox.com/asset?id=55800313"
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
09 Jul 2011 05:32 PM
@Agent What?
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
09 Jul 2011 05:33 PM
Your texture variable held the wrong link.
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
09 Jul 2011 05:35 PM
What do you mean?
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
09 Jul 2011 05:43 PM
You want the asset id of the T-Shirt, not the item id.
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
09 Jul 2011 05:43 PM
Sorry threadmaker, but I rofl'd.
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
09 Jul 2011 05:44 PM
And agent, you're good with being persistent. :P
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
09 Jul 2011 05:47 PM
@Agent, lost cause...Lol

@OwnerOfThread, A learn to script, B no free models, pl0x.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
09 Jul 2011 06:00 PM
Oh well.



function getAssetId(link)
local num = tonumber(link:reverse():match("(%d+)"):reverse())
local item = "http://www.roblox.com/Item.aspx?id="..(num-1)
local asset = "http://www.roblox.com/asset?id="..(num-1)
print("Check this link to see if it's your image: ", item)
print("If that link is correct, use this asset: ", asset)
print("--------------------------------------------")
print("If the given link was incorrect, insert the image link into the function")
end

getAssetId("http://www.roblox.com/Survive-Epic-Disasters-VIP-item?id=55800314")



This requires the use of Edit mode and View > Output. Or you could always use that code on this site:

http://www.lua.org/cgi-bin/demo


This is for the beginners. :P
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
09 Jul 2011 06:04 PM
@Agent How do you find the asset ID of the T-Shirt?
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
09 Jul 2011 06:07 PM
Take the numbers in the 'id=#########' section and subtract one from it. Then insert the numbers at the end of the string 'http://www.roblox.com/Item.aspx?id=' and if the resulting page has an item that belongs to you, the asset id is 'http://www.roblox.com/asset?id=' with the number at the end.
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
09 Jul 2011 06:11 PM
@chiken Why?
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
09 Jul 2011 06:11 PM
@Agent What do you mean and subtract one from it?
Report Abuse
ieatboulders2 is not online. ieatboulders2
Joined: 11 May 2009
Total Posts: 11754
09 Jul 2011 06:13 PM
print ("VIP T-Shirt Door Script Loaded")

permission = { "Legend8887" } -- This is how many people can still get through, so u don't have to change shirts. You can also have another friend here.


texture = "http://www.roblox.com/asset/?id=55800313"
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
Door.Transparency = 0.6
Door.CanCollide = false
wait(3) -- this is how long the door is open
Door.CanCollide = true
Door.Transparency = 0
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.6
Door.CanCollide = false
wait(3) -- 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
ieatboulders2 is not online. ieatboulders2
Joined: 11 May 2009
Total Posts: 11754
09 Jul 2011 06:16 PM
@Legend

I fixed it, look at my last post.
When you upload a shirt, tshirt, pants, decal, then it always becomes an image to be approved by the mods before it becomes a decal, shirt, tshirt, etc.

So basically, you need the image ID instead of the tshirt or shirt ID.

So to access the image ID, you just subtract one from the regular ID.

So if the shirt ID was 55800314, then -1 and it's 55800313. Try it, and you'll see the image you uploaded, which is right here:

http://www.roblox.com/cooltext538296385-item?id=55800313
Report Abuse
zack11212 is not online. zack11212
Joined: 24 Aug 2009
Total Posts: 301
09 Jul 2011 06:44 PM
You cant have permission or it wont work so remove your permission and only use the t-shirt.
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
09 Jul 2011 06:52 PM
@ieatboulders Ok, I think I fixed it. But now, if you own the T-Shirt, but you're not wearing it, you can still get into the VIP Room. How do I fix it so you HAVE to be wearing the T-Shirt in order to get into the VIP Room?
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
09 Jul 2011 06:59 PM
@zack How?
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
09 Jul 2011 07:00 PM
I meant how will it mess it up? :3
Report Abuse
ieatboulders2 is not online. ieatboulders2
Joined: 11 May 2009
Total Posts: 11754
09 Jul 2011 07:03 PM
I don't see if it makes a difference if they're wearing it or not.
Any specific reasons they need to be wearing it? If not, just keep it how it is.
If so, reply back.
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
09 Jul 2011 07:06 PM
Well, if I have it where you don't HAVE to be wearing the T-Shirt, don't you think noobs will think you don't have to have a T-Shirt at all? So they will keep trying to get into the VIP Room.
Report Abuse
ieatboulders2 is not online. ieatboulders2
Joined: 11 May 2009
Total Posts: 11754
09 Jul 2011 10:08 PM
We'll they wont be able to, so basically it just keeps them their longer for more people to arrive, meaning bigger servers, meaning front page faster.
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