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

Would this work for a custom Chatbar?

Asked by
Asirix 15
10 years ago
Message = script.Parent["Message"]
Chatbar = script.Parent

function Chat()

local mouse = game.Players.LocalPlayer:GetMouse() 
    mouse.KeyDown:connect(function (key) 
        if key == 'enter' then 
    game.Players.PlayerAdded:connect(function(pl)
    pl.Chatted:connect(function(msg)
        msg = Message.Text
    end)
    end)
    end
    end)
end

1 answer

Log in to vote
2
Answered by 10 years ago

You'd have to change if key == 'enter' then to if key == string.char(13) then. I believe that's the correct number. If it isn't, go here: Taking Keyboard Input. I hope this helped!

Ad

Answer this question