Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why this won't work?

Asked by
Xianon 105
10 years ago
local Aut1 = game.Workspace.Door.Aut1
local Aut2 = game.Workspace.Door.Aut2

function OnTouch(part)
 debounce = false
 local humanoid = part.Parent:findFirstChild("Humanoid")
 if Humanoid ~= nil then
  Aut1.Position = vector3.new(Aut1.Position.x, Aut1.Position.y, Aut1.Position.z+5)
  Aut2.Position = vector3.new(Aut1.Position.x, Aut2.Position.y, Aut2.Position.z-5)
  wait(5)
  Aut1.Position = vector3.new(Aut1.Position.x, Aut1.Position.y, Aut1.Position.z-5)
  Aut2.Position = vector3.new(Aut2.Position.x, Aut2.Position.y, Aut2.Position.z+5)
  print("The Script Works")
 end
end
0
u have if Humanoid change it to just humanoid DragonSkyye 517 — 10y
0
You defined 'humanoid' with a lowercase h, in your variable, so when you call it, it's Case Sensitive. systematicaddict 295 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

Line 7: You defined a variable called 'humanoid'. The error is caused in line 7: which is that you used "Humanoid" instead of "humanoid". Computers are stubborn in a way when reading code of any sort, and everything is case-sensitive.

Ad

Answer this question