Hi! I’m getting an error that the line 12 of my code, but I cant see the error.
local janela = game:GetService("Workspace").CurrentMission.Wilbur:WaitForChild("ToPlaceInWorkspace"):WaitForChild("Cameras"):WaitForChild("WindowCamera")
Hi! I’m getting an error that the line 12 of my code, but I cant see the error.
local janela = game:GetService("Workspace").CurrentMission.Wilbur:WaitForChild("ToPlaceInWorkspace"):WaitForChild("Cameras"):WaitForChild("WindowCamera")
local janela = game:GetService("Workspace").CurrentMission.Wilbur:WaitForChild("ToPlaceInWorkspace"):WaitForChild("Cameras"):WaitForChild("WindowCamera"))
I don’t think this would be correct. There’s no reason to have an extra )
at the end. I’m not sure why the code is erroring, but it definitely isn’t because of a missing )
at the end.
Do correct me if I’m wrong!
This sounds like it’s actually a problem elsewhere in the script, since this is specifically referring to function arguments. The Lua parser can be a bit weird with this kind of thing, is there a function directly before or after this line?
What’s strange is that the script broke alone, withou I touching anything. It was working perfectly yesterday
Can you show the full script and a screenshot of the error in the output?
FULL SCRIPT:
local TouchPart = game:GetService("Workspace").CurrentMission.StartWilburDialogue
local camera = game.Workspace.CurrentCamera
local TweenService = game:GetService("TweenService")
local fade = script.Parent.Parent.StartCutscene.Frame
--Cameras
local cameras = game:GetService("Workspace").CurrentMission.Wilbur:WaitForChild("ToPlaceInWorkspace"):WaitForChild("Cameras")
local carBack = game:GetService("Workspace").CurrentMission.Wilbur:WaitForChild("ToPlaceInWorkspace"):WaitForChild("Cameras"):WaitForChild("CameraCarBack")
local grass = game:GetService("Workspace").CurrentMission.Wilbur:WaitForChild("ToPlaceInWorkspace"):WaitForChild("Cameras"):WaitForChild("CameraGrass")
local casa = game:GetService("Workspace").CurrentMission.Wilbur:WaitForChild("ToPlaceInWorkspace"):WaitForChild("Cameras"):WaitForChild("HouseCamera")
local playerFront = game:GetService("Workspace").CurrentMission.Wilbur:WaitForChild("ToPlaceInWorkspace"):WaitForChild("Cameras"):WaitForChild("PlayerFront")
local wilbur = game:GetService("Workspace").CurrentMission.Wilbur:WaitForChild("ToPlaceInWorkspace"):WaitForChild("Cameras"):WaitForChild("WilburFront")
local janela = game:GetService("Workspace").CurrentMission.Wilbur:WaitForChild("ToPlaceInWorkspace"):WaitForChild("Cameras"):WaitForChild("WindowCamera"))
--Cloning
local destino = game:GetService("Workspace").CurrentMission.Wilbur.ToPlaceInWorkspace
local lugar = game:GetService("ReplicatedStorage").Wilbur.PlaceAfter
local RE = game:GetService("Workspace").ServerStuff.Events.MissionsEvents.TimeOfChange.WilburResto.RemoteEvent
--Text
local mainText = script.Parent.MainDialogues
--Wilbur faces
local wilburN = game:GetService("Workspace").CurrentMission.Wilbur.ToPlaceInWorkspace.Wilbur.Head.Normal
local wilburT = game:GetService("Workspace").CurrentMission.Wilbur.ToPlaceInWorkspace.Wilbur.Head.Talking
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local debounce = false
local function onTouch(hit)
if hit.Name == "Right Leg" then
if debounce then return end
debounce = true
TweenService:Create(
fade,
TweenInfo.new(2),
{BackgroundTransparency = 0}
):Play()
wait(2.2)
camera.CameraType = Enum.CameraType.Scriptable
Character.Torso.CFrame = CFrame.new(783.851, 75.418, -122.09)
camera.CFrame = janela.CFrame
wait(2)
TweenService:Create(
fade,
TweenInfo.new(2),
{BackgroundTransparency = 1}
):Play()
wait(2.6)
wait(0.1)
TouchPart:Destroy()
wait(6.5)
camera.CFrame = wilbur.CFrame
RE:FireServer()
wait(0.1)
wait(4.5)
camera.CFrame = playerFront.CFrame
------------------------------------------------------------------------------------------
local pTalk = game:GetService("Workspace").CurrentMission.Wilbur.Player.Head.FaceTalk
local pNormal = game:GetService("Workspace").CurrentMission.Wilbur.Player.Head.FaceNormal
local pAngry = game:GetService("Workspace").CurrentMission.Wilbur.Player.Head.FaceAngry
------------------------------------------------------------------------------------------
pTalk.Transparency = 0
pNormal.Transparency = 1
pAngry.Transparency = 1
mainText.Text = ("Henry: Hey...?")
wait(4)
camera.CFrame = wilbur.CFrame
wait(0.5)
wilburN.Transparency = 1
wilburT.Transparency = 0
mainText.Text = ("Wilbur: Wilbur. Sheriff Wilbur.")
wait(3.5)
mainText.Text = ("Wilbur: So you're Henry, the new guy, right?")
wait(5)
pTalk.Transparency = 0
pNormal.Transparency = 1
wilburN.Transparency = 0
wilburT.Transparency = 1
camera.CFrame = playerFront.CFrame
wait(0.5)
mainText.Text = ("Henry: Yeah... did I do something wrong Sheriff?")
wait(6)
camera.CFrame = carBack.CFrame
mainText.Text = ("Wilbur: No... at least not yet.")
wait(4)
mainText.Text = ("Wilbur: Hm... I'll be straight with you.")
wait(5.5)
camera.CFrame = grass.CFrame
mainText.Text = ("Wilbur: If you are one of those stupid reporters...")
wait(4.8)
mainText.Text = ("Wilbur: That came here to investigate what happened on that house...")
wait(5.5)
mainText.Text = ("Wilbur: I'll make sure you're not welcome here.")
wait(5.4)
camera.CFrame = janela.CFrame
mainText.Text = (" ")
wait(0.2)
script.Parent.psel1.Visible = true
wait(1)
script.Parent.psel2.Visible = true
wait(0.3)
script.Parent.psel2.input.Disabled = false
script.Parent.psel1.input.Disabled = false
end
end
TouchPart.Touched:Connect(onTouch)
At the end of this line, there’s an extra parenthesis.
yes yes, i put it there as @saouvs said, but it looks wrong
Ok, do you see any code that’s underlined with red?
Nope, no code underlined with red
Try using workspace instead of game:GetService(“Workspace”), not that I know if it’ll work.
As I said, the code broked alone. It was working perfectly. And it also works fine in studio.
(going to try GetService then)
Can you check again if it works?
Tested in studio now, works perfectly. Now testing in game
Looking at the code, I saw no mistakes. I also tried putting it into my studio and checked it through Script Analysis. No errors here.
That’s why I said it is strange, looks like roblox hates me, lol
Just to make things look a bit nicer, should do the same thing tho.
--[[ Variables ]]--
local TouchPart = workspace.CurrentMission.StartWilburDialogue
local camera = workspace.CurrentCamera
local TweenService = game:GetService("TweenService")
local fade = script.Parent.Parent.StartCutscene.Frame
local Wilber = workspace.CurrentMission.Wilbur
--Cameras
local cameras = Wilber:WaitForChild("ToPlaceInWorkspace"):WaitForChild("Cameras")
local carBack = cameras:WaitForChild("CameraCarBack")
local grass = cameras:WaitForChild("CameraGrass")
local casa = cameras:WaitForChild("HouseCamera")
local playerFront = cameras:WaitForChild("PlayerFront")
local wilbur = cameras:WaitForChild("WilburFront")
local janela = cameras:WaitForChild("WindowCamera") -- This is the supposed line that gets an error
--Cloning
local destino = Wilber.ToPlaceInWorkspace
local lugar = game:GetService("ReplicatedStorage").Wilbur.PlaceAfter
local RE = workspace.ServerStuff.Events.MissionsEvents.TimeOfChange.WilburResto.RemoteEvent
--Text
local mainText = script.Parent.MainDialogues
--Wilbur faces
local wilburN = Wilber.ToPlaceInWorkspace.Wilbur.Head.Normal
local wilburT = Wilber.ToPlaceInWorkspace.Wilbur.Head.Talking
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
--[[ Functions ]]--
local debounce = false
local function onTouch(hit)
if hit.Name == "Right Leg" then
if debounce then return end
debounce = true
local tween = TweenService:Create(fade, TweenInfo.new(2), {BackgroundTransparency = 0})_Play()
tween:Play()
tween.Completed:Wait(.2)
camera.CameraType = Enum.CameraType.Scriptable
Character.Torso.CFrame = CFrame.new(783.851, 75.418, -122.09)
camera.CFrame = janela.CFrame
wait(2)
tween = TweenService:Create(fade, TweenInfo.new(2), {BackgroundTransparency = 0})_Play()
tween:Play()
tween.Completed:Wait(.7)
TouchPart:Destroy()
wait(6.5)
camera.CFrame = wilbur.CFrame
RE:FireServer()
wait(4.6)
camera.CFrame = playerFront.CFrame
------------------------------------------------------------------------------------------
local pTalk = Wilber.Player.Head.FaceTalk
local pNormal = Wilber.Player.Head.FaceNormal
local pAngry = Wilber.Player.Head.FaceAngry
------------------------------------------------------------------------------------------
pTalk.Transparency = 0
pNormal.Transparency = 1
pAngry.Transparency = 1
mainText.Text = ("Henry: Hey...?")
wait(4)
camera.CFrame = wilbur.CFrame
wait(0.5)
wilburN.Transparency = 1
wilburT.Transparency = 0
mainText.Text = ("Wilbur: Wilbur. Sheriff Wilbur.")
wait(3.5)
mainText.Text = ("Wilbur: So you're Henry, the new guy, right?")
wait(5)
pTalk.Transparency = 0
pNormal.Transparency = 1
wilburN.Transparency = 0
wilburT.Transparency = 1
camera.CFrame = playerFront.CFrame
wait(0.5)
mainText.Text = ("Henry: Yeah... did I do something wrong Sheriff?")
wait(6)
camera.CFrame = carBack.CFrame
mainText.Text = ("Wilbur: No... at least not yet.")
wait(4)
mainText.Text = ("Wilbur: Hm... I'll be straight with you.")
wait(5.5)
camera.CFrame = grass.CFrame
mainText.Text = ("Wilbur: If you are one of those stupid reporters...")
wait(4.8)
mainText.Text = ("Wilbur: That came here to investigate what happened on that house...")
wait(5.5)
mainText.Text = ("Wilbur: I'll make sure you're not welcome here.")
wait(5.4)
camera.CFrame = janela.CFrame
mainText.Text = (" ")
wait(0.2)
script.Parent.psel1.Visible = true
wait(1)
script.Parent.psel2.Visible = true
wait(0.3)
script.Parent.psel2.input.Disabled = false
script.Parent.psel1.input.Disabled = false
end
end
TouchPart.Touched:Connect(onTouch)