I am making a custom chat, which uses the same thing as kinda like roblox's chat but I disabled the coregui for chat. This works in studio but doesnt work in player so It must be something to do with the keybyte() == 47 anyone know how to enable it?
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local able = false
local default = script.Default
function onkey(key)
if key:byte() == 47
then
script.Parent:TweenSizeAndPosition(UDim2.new(1,0,.05,0), UDim2.new(0,0,.45,0), "Out", "Quad", .5, true)
script.Parent.TextXAlignment = "Center"
script.Parent:CaptureFocus()
able = true
end
end
function clear()
script.Parent:TweenSizeAndPosition(UDim2.new(1,0,.025,0), UDim2.new(0,0,.975,0), "Out", "Quad", .5, true)
script.Parent.TextXAlignment = "Left"
able = false
script.Parent.Text = default.Value
end
mouse.KeyDown:connect(onkey)
script.Parent.FocusLost:connect(clear)

5 comments
Is this in a localscript?
mhm
I'm pretty sure you can just a string for slash, like 'if key == "/" then end'
.... nope
You can do ... if key == "/" then ... I've done it before, and it works just fine.