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 » Scripters
Home Search
 

Re: Why won't this work?

Previous Thread :: Next Thread 
JustSpent1k is not online. JustSpent1k
Joined: 27 Mar 2013
Total Posts: 674
07 Apr 2015 03:21 PM
local Door = script.Parent

function OnTouched (Player)
local Player = Player.Parent:findfirstChild("Humanoid")
if (player) ~= nil then
if Player.Parent.Torso.Texture == http://www.robloc.com/asset/?version=&id=1028594
then
Door.Cancollide = false
Door.Transparency 0.5
wait (3)
Door.CanCollide = true
Door.Transparency = 0
else
Player.health = 0
end

end

end


Door.Touched:connect(OnTouched)
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
07 Apr 2015 03:22 PM
"if Player.Parent.Torso.Texture == http://www.robloc.com/asset/?version=&id=1028594"

"robloc"
Change that to x!
Report Abuse
Seattlantis is not online. Seattlantis
Joined: 24 Jul 2013
Total Posts: 5560
07 Apr 2015 03:29 PM
LOTS of things went wrong with your script, mainly just a bunch of typos and places where you skipped a child but I fixed everything and this is the working script:

local Door = script.Parent

function OnTouched (hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
if (humanoid) ~= nil then
if humanoid.Parent.Torso.roblox.Texture == "http://www.roblox.com/asset/?version=&id=1028594" then
Door.Cancollide = false
Door.Transparency = 0.5
wait (3)
Door.CanCollide = true
Door.Transparency = 0
else
humanoid.Health = 0
end
end
end

Door.Touched:connect(OnTouched)





also when you use roblox asset links (http://www.roblox.com/asset/) make sure you put parenthesis around them so that the script knows it's a string.
Report Abuse
Seattlantis is not online. Seattlantis
Joined: 24 Jul 2013
Total Posts: 5560
07 Apr 2015 03:32 PM
missed a spot, in the script I posted replace

"http://www.robloc.com/asset/?version=&id=1028594"

with

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

Report Abuse
Seattlantis is not online. Seattlantis
Joined: 24 Jul 2013
Total Posts: 5560
07 Apr 2015 03:35 PM
Missed another spot, this is the complete working script (for real this time):


local Door = script.Parent

function OnTouched (hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
if (humanoid) ~= nil then
if humanoid.Parent.Torso.roblox.Texture == "http://www.roblox.com/asset/?id=1028594" then
Door.CanCollide = false
Door.Transparency = 0.5
wait (3)
Door.CanCollide = true
Door.Transparency = 0
else
humanoid.Health = 0
end
end
end

Door.Touched:connect(OnTouched)
Report Abuse
AnimatedUglyPet is not online. AnimatedUglyPet
Joined: 23 Feb 2013
Total Posts: 364
07 Apr 2015 03:35 PM
No, get out, you don't belong here.
Report Abuse
RelaxRobby is not online. RelaxRobby
Joined: 11 Apr 2011
Total Posts: 104
07 Apr 2015 03:46 PM
@AnimatedUglyPet

I see you everywhere you nasty girl.
Report Abuse
AnimatedUglyPet is not online. AnimatedUglyPet
Joined: 23 Feb 2013
Total Posts: 364
07 Apr 2015 03:50 PM
Learn to script before posting here, I am a 100 times better scripter than you.
Report Abuse
RelaxRobby is not online. RelaxRobby
Joined: 11 Apr 2011
Total Posts: 104
07 Apr 2015 03:52 PM
print("Hello world!")

Doesn't make you better in scripting.
Report Abuse
AnimatedUglyPet is not online. AnimatedUglyPet
Joined: 23 Feb 2013
Total Posts: 364
07 Apr 2015 03:53 PM
thats not even your own script, you copied it from the wiki you dumb ####.
Report Abuse
RelaxRobby is not online. RelaxRobby
Joined: 11 Apr 2011
Total Posts: 104
07 Apr 2015 04:14 PM
Actually not, if you create a new script, it contains that print first.

Cute that you know that it's on wiki.
Report Abuse
AnimatedUglyPet is not online. AnimatedUglyPet
Joined: 23 Feb 2013
Total Posts: 364
09 Apr 2015 03:22 PM
then you copy it also from new script
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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