#The cube doesn't show up the Dialogue

1 messages · Page 1 of 1 (latest)

vale solar
#

script:` --main stuffs--

local gui = script.Parent
local textbox = script.Parent.Textbox
local textlabel = script.Parent.Textbox.TextLabel
local player = game.Players.LocalPlayer
local dialogueFolder = game.Workspace.dialogueFolder
local placeholderdialogue = dialogueFolder.placeholderdialogue

--variables--

gui.Enabled = false
textbox.Visible = false

--functions--

local function writeText(text,waitTime)
player.Character:WaitForChild("Humanoid").WalkSpeed = 0
player.Character:WaitForChild("Humanoid").JumpPower = 0
gui.Enabled = true
textbox.Visible = true
textlabel.Text = text
task.wait(waitTime)
end

local function endDialogue()
player.Character:WaitForChild("Humanoid").WalkSpeed = 16
player.Character:WaitForChild("Humanoid").JumpPower = 50
gui.Enabled = false
textbox.Visible = false
textlabel.Text = ""
end

--Dialogues--

placeholderdialogue.Triggered:Connect(function()
placeholderdialogue.Enabled = false

writeText("PlaceHolder",2)

writeText("PlaceHolder",2)

endDialogue()
placeholderdialogue.Enabled = true

end)`

candid olive
#

try to debug it

#

also i'm assuming placeholderdialogue is a proximity prompt, right?

#

i found the problem

#

you haven't made a variable for the proximity prompt inside placeholderdialogue (the cube)

#
--main stuffs--

local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local dialogueFolder = game.Workspace.dialogueFolder
local placeholderdialogue = dialogueFolder:WaitForChild("PlaceholderDialogue") -- errored here before aswell, because you wrote "placeholderdialogue" instead of the correct version

local gui = script.Parent
local textbox = script.Parent:WaitForChild("Textbox")
local textlabel = textbox:WaitForChild("TextLabel")

--variables--

gui.Enabled = false
textbox.Visible = false


--functions--

local hum = char:WaitForChild("Humanoid")
local function writeText(text,waitTime)
    hum.WalkSpeed = 0
    hum.JumpPower = 0
    gui.Enabled = true
    textbox.Visible = true
    textlabel.Text = text
    task.wait(waitTime)
end

local function endDialogue()
    hum.WalkSpeed = 16
    hum.JumpPower = 50
    gui.Enabled = false
    textbox.Visible = false
    textlabel.Text = ""
end

--Dialogues--

local prompt = placeholderdialogue:WaitForChild("ProximityPrompt")

prompt.Triggered:Connect(function() -- errored  here before
    prompt.Enabled = false

    writeText("PlaceHolder",2)
    
    writeText("PlaceHolder",2)
    
    endDialogue()
    prompt.Enabled = true
end)

here is the edited script

rare gorge
#

btw if your tryna make a typewriter

#

thats not it

vale solar
#

soo i have another problem...