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: group door broken

Previous Thread :: Next Thread 
AdvancedDrone is online. AdvancedDrone
Joined: 17 Apr 2010
Total Posts: 2599
21 Apr 2017 08:10 AM
So, I'm trying to script a group door, and it works for a couple of times and after like 3-4 tries, it errors on output and I have no clue what's wrong with it.

-- Workspace.Part.Script:15: attempt to index local 'v' (a nil value)

line 15 is the one where it says local check = v.Check
(there is a bool value that is in the player named Check and it switches between true and false)


local enterBrick = game.Workspace:WaitForChild('1')
local exitBrick = game.Workspace:WaitForChild('2')

local debounce = false

local groupId = 29#######
#
#s############################################ if debounce == false then
debounce = true
wait()
local p = hit.Parent.Name
local v = game.Players:FindFirstChild(p)
local check = v.Check
if v:IsInGroup(groupId) and check.Value == false and check then
v.Character:MoveTo(enterBrick.Position + Vector3.new(0,1,0))
check.Value = true
elseif check.Value == true and v:IsInGroup(groupId) and check then
v.Character:MoveTo(exitBrick.Position + Vector3.new(0,1,0))
check.Value = false
end
wait(2.5)
debounce = false
end
end)



Report Abuse
AdvancedDrone is online. AdvancedDrone
Joined: 17 Apr 2010
Total Posts: 2599
21 Apr 2017 08:11 AM
idk why that got hashtagged, it was just the script.Parent touched function oops


Report Abuse
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
21 Apr 2017 08:16 AM
local v = game.Players:FindFirstChild(p)
local check = v.Check


Change that to this

local v = game.Players:FindFirstChild(p)
if (v) then
local check = v.Check


And then change this
end
wait(2.5)
debounce = false
end
end)


to this

end
end
wait(2.5)
debounce = false
end
end)
Report Abuse
AdvancedDrone is online. AdvancedDrone
Joined: 17 Apr 2010
Total Posts: 2599
21 Apr 2017 08:21 AM
i did that and then the lines that used check variable in the if statement turned blue


Report Abuse
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
21 Apr 2017 08:23 AM
Show me what you did please, on pastebin if you can so it doesn't get hashtag.
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