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: Trying to make an admin door script

Previous Thread :: Next Thread 
Nenno is not online. Nenno
Joined: 14 Oct 2009
Total Posts: 9208
05 Jul 2015 05:52 AM
local adminDoor = script.Parent

function onTouched(part)
if game.Players.Player.Name = ("Nenno") then
adminDoor.CanCollide = false
else
adminDoor.CanCollide = true
end
end

adminDoor.Touched:connect(onTouched)

Something is wrong with it. Can you guys help me? I'm new to scripting.
Report Abuse
Nenno is not online. Nenno
Joined: 14 Oct 2009
Total Posts: 9208
05 Jul 2015 06:24 AM
b
Report Abuse
Nenno is not online. Nenno
Joined: 14 Oct 2009
Total Posts: 9208
05 Jul 2015 06:35 AM
b
Report Abuse
FearlessBiscuit is not online. FearlessBiscuit
Joined: 16 Jun 2013
Total Posts: 1157
05 Jul 2015 06:38 AM
local adminDoor = script.Parent

script.Parent.Touched:connect(function(hit)
if hit.Name = ("Nenno") then
adminDoor.CanCollide = false
else
hit:FindFirstChild("Humanoid").Health = 0
adminDoor.CanCollide = true
end
end)
Report Abuse
Nenno is not online. Nenno
Joined: 14 Oct 2009
Total Posts: 9208
05 Jul 2015 06:40 AM
@fearless

Thank you you magnificent bastard. Can you direct me to a wiki article that explains the hit function?
Report Abuse
FearlessBiscuit is not online. FearlessBiscuit
Joined: 16 Jun 2013
Total Posts: 1157
05 Jul 2015 06:41 AM
Yea sure buddy :D

http://wiki.roblox.com/index.php?title=Basic_Scripting
Report Abuse
Nenno is not online. Nenno
Joined: 14 Oct 2009
Total Posts: 9208
05 Jul 2015 06:42 AM
Oh, it encountered a problem

13:41:18.575 - Workspace.AdminDoor.Script:6: 'then' expected near '='
Report Abuse
FearlessBiscuit is not online. FearlessBiscuit
Joined: 16 Jun 2013
Total Posts: 1157
05 Jul 2015 06:43 AM
script.Parent.Touched:connect(function(hit)
if hit.Name == ("Nenno") then
adminDoor.CanCollide = false
else
hit:FindFirstChild("Humanoid").Health = 0
adminDoor.CanCollide = true
end
end)

-- Forgot the double = with if my bad :P
Report Abuse
Nenno is not online. Nenno
Joined: 14 Oct 2009
Total Posts: 9208
05 Jul 2015 06:44 AM
Okay, thanks. Now I can make an obby with the boost panel and lava scripts I made (my first attempt at scripting.
Report Abuse
FearlessBiscuit is not online. FearlessBiscuit
Joined: 16 Jun 2013
Total Posts: 1157
05 Jul 2015 06:45 AM
np :P
Report Abuse
Nenno is not online. Nenno
Joined: 14 Oct 2009
Total Posts: 9208
05 Jul 2015 06:52 AM
I had to edit the script a bit to make it work.


local adminDoor = script.Parent

script.Parent.Touched:connect(function(hit)

if hit.Parent.Name == ("Nenno") then
adminDoor.CanCollide = false
else
game.Workspace.Player.Humanoid.Health = 0
end
end)

But thanks for making me realise that the hit function is useful in so many ways.
Report Abuse
FearlessBiscuit is not online. FearlessBiscuit
Joined: 16 Jun 2013
Total Posts: 1157
05 Jul 2015 06:54 AM
game.Workspace.Player.Humanoid.Health = 0

This wouldn't work so use

hit.Parent:FindFirstChild('Humanoid').Health = 0 -- :P
Report Abuse
Nenno is not online. Nenno
Joined: 14 Oct 2009
Total Posts: 9208
05 Jul 2015 07:06 AM
But it worked, I got killed on my alt. I just want to start off with simple scripts.
Report Abuse
FearlessBiscuit is not online. FearlessBiscuit
Joined: 16 Jun 2013
Total Posts: 1157
05 Jul 2015 07:09 AM
kk
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