Im trying to make a dialogue system for my game but I can't figure out how to make a function where if interact >= 1 then it waits for that amount of time but if interact == true then it waits for an E input where it wont move on to the next dialogue until you press E. My problem is it won't wait for me to press E and instead continues and moves on without showing the text. The interact >= 1 works but the true and false stuff doesn't
#Dialogue system
1 messages · Page 1 of 1 (latest)
the code:
local function writeText(text, interact) --copy this "writeText..." inside () text = write text there, interact = if true press E otherwise put number
Humanoid.WalkSpeed = 0
gui.Enabled = true
textbox.Visible = true
image.Visible = true
textLabel.Text = text
sound:Play()
if interact >= 5 then
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.E then
task.wait(0.1)
print("Pressing E worked")
task.wait(0)
else
task.wait(0.01)
return
end
end)
else
if interact >= 1 then
print("variable found but no true")
task.wait(interact)
interact = false
else
print("found NOTHING")
task.wait(1)
interact = false
end
end
end
dawg what’s the point in a task.wait(0)😭
why are you using if check to see if a boolean is greater than 1
hm
idek whats happening
local function writeText(text, interact) --copy this "writeText..." inside () text = write text there, interact = if true press E otherwise put number
Humanoid.WalkSpeed = 0
gui.Enabled = true
textbox.Visible = true
image.Visible = true
textLabel.Text = text
sound:Play()
if interact >= 5 then
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.E then
task.wait(0.1)
print("Pressing E worked")
task.wait(0)
else
task.wait(0.01)
return
end
end)
else
if interact >= 1 then
print("variable found but no true")
task.wait(interact)
interact = false
else
print("found NOTHING")
task.wait(1)
interact = false
end
end
end
quesiton mark
yeah im confused aswell ggs
what're you tryna achieve, whats interact, why are u checking if its greater than 5
i just put it as a codeblock
😭
yeahso what're u tryna make
i couldnt read the OP's original code cause it wasnt on format so i just pasted the same code, but in format so i can read it
-# and that my screen resolution is fucked up...
nun i was tryan read it but got confused half way on what the fuck is going on 💔
i think im too sleepy to help
I didn’t even realize icl
I probably should’ve fixed that
I wanted to make it so that if I put a number in the Boolean then it’d run that number but if I wrote true it’d run the wait for the E input but that’s probably what’s messing it up
wtf is this fuckign script
idek man i wanted to try and see if it worked 😔
im probably gonna split it into two different functions rather than trying to make it into one singular function
Humanoid.WalkSpeed = 0
gui.Enabled = true
textbox.Visible = true
image.Visible = true
textLabel.Text = text
sound:Play()
if interact == true then
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.E then
task.wait(0.1)
print("Pressing E worked")
task.wait(0.01)
interact = false
else
print("Waiting for input")
task.wait(0.01)
return
end
end)
else
print("true didn't work")
task.wait(1)
end
end```
I made it just a boolean but it still doesnt wait for the input before ending the function
I made a dialogue system in my game and it works pretty well.
how did you make it
Once I get back home I’ll give u a like to my game
alr
could you set it as public
** You are now Level 3! **
Sure
Check it now
its unrated so it wont let me look at it 😔
you probably should also make it open source but idk how you would do that
I don’t really wanna make it opened source, but It’s basically just a copy of supdoggy’s dialogue system. All I did was rewrite the code to make it easier to work with.
Heres the video if u want it https://youtu.be/hPEE5ol6xc4?si=NI7YapjEf0kUVhCq
Explaining how to customize the custom dialogue system I made
Dialogue System ➜ https://create.roblox.com/store/asset/80608769509945/
MAIN CHANNEL ➜ https://www.youtube.com/@supdoggy_
DISCORD SERVER ➜ discord.gg/supcord
SUP STUDIOS ➜ https://www.roblox.com/groups/11607234/SUP-Studios#!/
Roblox profile ➜ https://www.roblox.com/users/...
this isnt the dialogue type I really wanted to make but thank you anyways
youre good
What was it then tho