Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would i make a mousebutton1down work in this situation?

I want the conversation to be click to continue but i don't know how to implement it here:

Mouse.KeyDown:connect(function(key)
 if not debounce then
		debounce = true
   if key == "f" then 
	local Chat1 = "Oh, hey there..."
	local Chat2 = "I'm saitama(Hero For Fun) and I see its your first time playing."
	local Chat3 = "I guess I'll be your guide."
	local Chat4 = "First off, you'll need to choose your class, "
    local Length = string.len(Chat1)
     for i=1,Length do
	script.Parent.NPCchat.Text.Text = string.sub(Chat1,1,i)
	wait(0.01)
     end

wait(2)

    local Length = string.len(Chat2)
     for i=1,Length do
	script.Parent.NPCchat.Text.Text = string.sub(Chat2,1,i)
	wait(0.01)
     end

wait(3)

    local Length = string.len(Chat3)
     for i=1,Length do
	script.Parent.NPCchat.Text.Text = string.sub(Chat3,1,i)
	wait(0.01)
     end

     wait(2)
  local Length = string.len(Chat4)
     for i=1,Length do
	script.Parent.NPCchat.Text.Text = string.sub(Chat4,1,i)
	wait(0.01)
     end
wait(3)
end) -- I know theres other ends here but i don't feel like putting it :P

1 answer

Try moving on into UserInputService. It's simpler and is currently still supported by Roblox (KeyDown is deprecated).

Debounce doesn't seem to be defined, and also just because you don't feel like putting ends doesn't mean you don't. You NEED to use ends no matter what. That may be why your script isn't working, but put any errors you get from the output so we know what's going wrong. Because other than using KeyDown and the ends I don't see anything wrong.

4 comments

0

This script is a shortened version of the one im using so theres alot more lines there and thats why i said i didnt feel like putting the other ends. Also, I prefer using KeyDown so...

0

KeyDown is deprecated, do not use it for new work http://wiki.roblox.com/index.php?title=API:Class/Mouse/KeyDown also you should post the full script in so that we know if anything is wrong.

0

:l Nothing is wrong I just wanted to know how to implement what i asked for into the script. But i guess you don't know.

0

I do know, I'm trying to help you. This isn't exactly a request site

This discussion is preserved as it was. New answers, comments, and votes are closed.