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

Dialogue script, nil value? [Skip to line "78", CLICK NOW, i need this for a school project :( ]

Asked by 4 years ago
Edited 4 years ago

Okay, to start of with i created a dialogue script. When i first started scripting i was passionate about dialogues, and wanted to make my custom one.

It actually turned very well! The only problem is when i started expanding on questions i got an error [Line 78] It's saying it's a nil value?


SCRIPT:


local aggromag = 20 local Cam = workspace.CurrentCamera local Debounce = false local Player = game.Players.LocalPlayer local UIS = game:GetService("UserInputService") repeat wait() until Player.Character local Character = Player.Character local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart") local FocusPart = game.Workspace.FocusPart local CameraPart = game.Workspace.CameraPart UIS.InputBegan:Connect(function(InputObject, Processed) if Processed then return end if (HumanoidRootPart.Position - FocusPart.Position).Magnitude < aggromag and InputObject.KeyCode == Enum.KeyCode.E and not Debounce then Debounce = true Cam.CameraType = "Scriptable" FocusPart.BillboardGui.TextLabel.Visible = false Cam:Interpolate(CameraPart.CFrame,FocusPart.CFrame, 1) script.Parent.Visible = true wait(1) script.Parent:TweenPosition(UDim2.new(0.319, 0, 0.500, 0)) local WelcomingString = "Hello, I'm maxpax2009, I give you quests you can achieve, Do you want to begin on your mission?" for i = 1, #WelcomingString do script.Parent.Content.Text = string.sub(WelcomingString, 1, i) wait(.05) end for i, option in pairs(script.Parent.Parent.Options:GetChildren()) do option.Visible = true end wait(5) Debounce = false function agree() local String = "Okay, your first quest will be to get 300 Points, and you will get a prize!" for a = 1, #String do script.Parent.Content.Text = string.sub(String, 1, a) wait(.05) script.Parent.Parent.Quest.Visible = true script.Parent.Parent.Quest:TweenPosition(UDim2.new(0.571, 0, 0.036, 0)) script.Parent.Parent.Quest.Text = "Get 300 Points and return to Max" end end function Anwer() wait(4) for i, option in pairs(script.Parent.Parent.Options:GetChildren()) do option.Visible = false Cam.CameraType = "Custom" script.Parent.Position = UDim2.new(0.211, 0, -0.444, 0) FocusPart.BillboardGui.TextLabel.Visible = true Cam.CameraSubject = Player.Character.Humanoid script.Parent.Visible = false end end end end) script.Parent.Parent.Options.Agree.Activated:Connect(function() agree() wait(1) Anwer() end)
0
I by accident wrote "Anwer", well i guess it's okay lol maxpax2009 340 — 4y
0
but line 79 is a wait...? Nguyenlegiahung 1091 — 4y
0
Sorry! Line 78!! maxpax2009 340 — 4y
0
Has anyone got an idea? I'm struggling to find out what the problem is? maxpax2009 340 — 4y

1 answer

Log in to vote
1
Answered by
Ciyob86 25
4 years ago
Edited 4 years ago
0
i delete it because you solved it. Ciyob86 25 — 4y
0
? maxpax2009 340 — 4y
0
How do you know i solved it? maxpax2009 340 — 4y
Ad

Answer this question