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: Whats wrong with this?

Previous Thread :: Next Thread 
RoseSting is not online. RoseSting
Joined: 16 Jun 2012
Total Posts: 24227
12 Feb 2015 07:58 PM
Output: Touched is not a valid member of Model

CurrentGroup = 650266
Door = script.Parent:FindFirstChild('Door2')
Handle1 = script.Parent:FindFirstChild('Door1')
Handle2 = script.Parent:FindFirstChild('Door3')
IsActive = false -- Do not modify
KillOnContact = false
WaitTime = 2


function Touched(Part)
if IsActive then return end
IsActive = true
if Part.Parent:findFirstChild("Humanoid") then
Player = game.Players:GetPlayerFromCharacter(Part.Parent)
if Player then
if Player:IsInGroup(CurrentGroup) then
Open()
else
Close()
end
end
end
IsActive = false
end

function Open()
print'InGroup'
local sound = game.Workspace.GD:FindFirstChild('Granted')
script.Parent.Touched:connect(function(p)
if p.Parent:FindFirstChild("Humanoid") then -- p.Parent, not p
local plr = game.Players:GetPlayerFromCharacter(p.Parent) -- find the player
local clonedsound = sound:Clone()
clonedsound.Parent = plr.PlayerGui
clonedsound:Play()
Door.Transparency = 0.4
Handle1.Transparency = 0.4
Handle2.Transparency = 0.4
Handle1.CanCollide = false
Handle2.CanCollide = false
Door.CanCollide = false
wait(WaitTime)
clonedsound:Destroy()
Door.CanCollide = true
Door.Transparency = 0
Handle1.Transparency = 0
Handle2.Transparency = 0
Handle1.CanCollide = true
Handle2.CanCollide = true
end
end)

Door.Touched:connect(Touched)

function Close()
print'NotInGroup'
local sound = game.Workspace.GD:FindFirstChild('Denied')
script.Parent.Touched:connect(function(p)
if p.Parent:FindFirstChild("Humanoid") then -- p.Parent, not p
local plr = game.Players:GetPlayerFromCharacter(p.Parent) -- find the player
local clonedsound = sound:Clone()
clonedsound.Parent = plr.PlayerGui
clonedsound:Play()
wait(7)
clonedsound:Destroy()
end
end)
end
end
Door.Touched:connect(Touched)

-~//Talk sense to a fool and he calls you foolish\\~- R$402
Report Abuse
Refactoring is not online. Refactoring
Joined: 20 Apr 2014
Total Posts: 329
12 Feb 2015 08:01 PM
-> Door.Touched:connect(Touched)

Is Door a model, if so that's your problem.

http://wiki.roblox.com/index.php?title=API:Class/BasePart/Touched
Report Abuse
RoseSting is not online. RoseSting
Joined: 16 Jun 2012
Total Posts: 24227
12 Feb 2015 08:02 PM
->Door = script.Parent:FindFirstChild('Door2')
The door is a part inside of a model named 'Door2'

-~//Talk sense to a fool and he calls you foolish\\~- R$402
Report Abuse
KLGA is not online. KLGA
Joined: 19 Apr 2014
Total Posts: 2571
12 Feb 2015 08:04 PM
->Door = script.Parent:FindFirstChild('Door2')
The door is a part inside of a model named 'Door2'

If the model's name is Door2, then unless the script is inside of a model named Door2, with that same model containing a Door2 part, that does not get a part named Door2.
Report Abuse
RoseSting is not online. RoseSting
Joined: 16 Jun 2012
Total Posts: 24227
12 Feb 2015 08:06 PM
No, the actual model is 'GD' and the "Door" is "Door2"

Door2 is inside the model named 'GD'.

Inside the model is a script with the parent set as the model that controls "Door2"

-~//Talk sense to a fool and he calls you foolish\\~- R$402
Report Abuse
KLGA is not online. KLGA
Joined: 19 Apr 2014
Total Posts: 2571
12 Feb 2015 08:07 PM
By what you said you're set up like this?

GD
>Script
>Door2
Report Abuse
RoseSting is not online. RoseSting
Joined: 16 Jun 2012
Total Posts: 24227
12 Feb 2015 08:13 PM
Like,

'GD' is the model

and the script along with the door is in the model named 'GD'

so

>GD
-Script
-Door2

-~//Talk sense to a fool and he calls you foolish\\~- R$402
Report Abuse
KLGA is not online. KLGA
Joined: 19 Apr 2014
Total Posts: 2571
12 Feb 2015 08:15 PM
i didn't read through all of it yet, but try changing findfirstchild to waitforchild, because maybe for some reason your doors are not in existence when the script runs
Report Abuse
RoseSting is not online. RoseSting
Joined: 16 Jun 2012
Total Posts: 24227
12 Feb 2015 08:16 PM
Idk why that would be e-e

-~//Talk sense to a fool and he calls you foolish\\~- R$402
Report Abuse
RoseSting is not online. RoseSting
Joined: 16 Jun 2012
Total Posts: 24227
12 Feb 2015 08:18 PM
When changing it to "WaitForChild"

You get the same output

-~//Talk sense to a fool and he calls you foolish\\~- R$402
Report Abuse
KLGA is not online. KLGA
Joined: 19 Apr 2014
Total Posts: 2571
12 Feb 2015 08:18 PM
what's the output?
Report Abuse
RoseSting is not online. RoseSting
Joined: 16 Jun 2012
Total Posts: 24227
12 Feb 2015 08:19 PM
Touched is not a valid member of Model

-~//Talk sense to a fool and he calls you foolish\\~- R$402
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
12 Feb 2015 08:20 PM
Is the script in a model
Report Abuse
KLGA is not online. KLGA
Joined: 19 Apr 2014
Total Posts: 2571
12 Feb 2015 08:20 PM
just because i'm a lazy person what line is this error for?
Report Abuse
RoseSting is not online. RoseSting
Joined: 16 Jun 2012
Total Posts: 24227
12 Feb 2015 08:20 PM
Yes Its in a model.

-~//Talk sense to a fool and he calls you foolish\\~- R$402
Report Abuse
KLGA is not online. KLGA
Joined: 19 Apr 2014
Total Posts: 2571
12 Feb 2015 08:21 PM
oh i just found your error.
you said script was inside of model GD

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

You're going to have to select the part you want there, because script.Parent is indeed a model.
Report Abuse
RoseSting is not online. RoseSting
Joined: 16 Jun 2012
Total Posts: 24227
12 Feb 2015 08:21 PM
Doesnt even say what line

-~//Talk sense to a fool and he calls you foolish\\~- R$402
Report Abuse
RoseSting is not online. RoseSting
Joined: 16 Jun 2012
Total Posts: 24227
12 Feb 2015 08:23 PM
KLGA

im lost?

-~//Talk sense to a fool and he calls you foolish\\~- R$402
Report Abuse
KLGA is not online. KLGA
Joined: 19 Apr 2014
Total Posts: 2571
12 Feb 2015 08:28 PM
you said the script is in a model,
your line is getting script.Parent.Touched
script.Parent is a model, models can't be touched, only parts.
Change your directory to a part. So instead of script.Parent.Touched
>script.Parent.Part.Touched
Report Abuse
RoseSting is not online. RoseSting
Joined: 16 Jun 2012
Total Posts: 24227
12 Feb 2015 08:29 PM
Ok I figured it out thanks

One problem...

Sometimes it auto loops over and over a few times...

Why does it do that?

-~//Talk sense to a fool and he calls you foolish\\~- R$402
Report Abuse
KLGA is not online. KLGA
Joined: 19 Apr 2014
Total Posts: 2571
12 Feb 2015 08:31 PM
It may be because you have two connection lines for the same function. Try deleting one.
Report Abuse
RoseSting is not online. RoseSting
Joined: 16 Jun 2012
Total Posts: 24227
12 Feb 2015 08:31 PM
And also sometimes it permanently stays with its transparency set at 0.4 and is walkthrough 24/7 after trying it twice.

is their a reason for this?

-~//Talk sense to a fool and he calls you foolish\\~- R$402
Report Abuse
RoseSting is not online. RoseSting
Joined: 16 Jun 2012
Total Posts: 24227
12 Feb 2015 08:32 PM
Connection lines for the same function?

Help me out here?

-~//Talk sense to a fool and he calls you foolish\\~- R$402
Report Abuse
RoseSting is not online. RoseSting
Joined: 16 Jun 2012
Total Posts: 24227
12 Feb 2015 08:35 PM
U mean delete one of these?

"Door.Touched:connect(Touched)"

Ok done,

One other problem. Is their a way to add a cooldown?

-~//Talk sense to a fool and he calls you foolish\\~- R$402
Report Abuse
RoseSting is not online. RoseSting
Joined: 16 Jun 2012
Total Posts: 24227
12 Feb 2015 08:41 PM
Huge problem...

this whole script dosent work... btw this is the denied part.

so everyone gets granted for some reason


function Close()
print'NotInGroup'
local sound = game.Workspace.GD:FindFirstChild('Denied')
script.Parent.Touched:connect(function(p)
if p.Parent:FindFirstChild("Humanoid") then -- p.Parent, not p
local plr = game.Players:GetPlayerFromCharacter(p.Parent) -- find the player
local clonedsound = sound:Clone()
clonedsound.Parent = plr.PlayerGui
clonedsound:Play()
wait(7)
clonedsound:Destroy()
end
end)
end
end
Door.Touched:connect(Touched)



-~//Talk sense to a fool and he calls you foolish\\~- R$402
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