|
| 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 |
|
|
|
| 21 Apr 2017 08:11 AM |
idk why that got hashtagged, it was just the script.Parent touched function oops
|
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|