So i created a dialogue script a few days ago...
The person who you are talking to gives you quests, he says i need to get 300 points then come back and you get a prize.
Now the thing is i don't know how to skip a line of script.
Here's my attempt, you don't need to read the whole script if you don't want too. I want the answer of what i should do in this case
Well you asked for it here is the long script.
local Debounce = false
local aggromag = 20
local Cam = workspace.CurrentCamera
local RemoteFunction = game:GetService("ReplicatedStorage").RemoteFunc
local ABounce = false
local Sword
local BBounce = 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
wait(2)
Debounce = false
for i, option in pairs(script.Parent.Parent.Options:GetChildren()) do
option.Visible = true
end
function CheckPoints()
local CongratsString = "Great, now you will be awarded with a sword. Keep in mind this sword can only be utilized in the pvp zone."
for t = 1, #CongratsString do
script.Parent.Content.Text = string.sub(CongratsString, 1, t)
Sword.Parent = Character
end
end
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()
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 Stop()
wait(3)
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)
if Player.leaderstats.Quest.Value == 0 then
script.Parent.Parent.Options.Agree.Activated:Connect(function()
if not ABounce then
ABounce = true
script.Parent.Parent.Options.Agree.Visible = false;
script.Parent.Parent.Options.Disagree.Visible = false;
RemoteFunction:InvokeServer()
agree()
wait(2)
Stop()
ABounce = false
end
end)
end
if Player.leaderstats.Quest.Value == 0 then
script.Parent.Parent.Options.Disagree.Activated:Connect(function()
if not BBounce then
BBounce = true
Stop()
wait(2)
BBounce = false
end
end)
if Player.leaderstats.Quest.Value == 1 then
CheckPoints()
end
end
