I am making custom chat, I tested everything it works with the enter button as the fire on the KeyDown() but I want it to be / but when I have it set it works in studio but not in player...
heres the script if you need it
wait(.5) local player = game.Players.LocalPlayer local mouse = player:GetMouse() local able = false local default = script.Default function ondown(key) if key:byte() == 13 and able == false then able = true 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() end end function clear(e) if e == true then game.Workspace.Fabrication_Framework.CoreGui_Script.Chat.RemoteFunction:InvokeServer(script.Parent.Text) print("Sent") end 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 script.Parent.FocusLost:connect(clear) mouse.KeyDown:connect(ondown)
Alright, to everyone saying you can't use '/' in a key. Actually you can, using UserInputService. No offense intended, just stating a fact. Also, here's the code to use it.
game:service'UserInputService'.InputBegan:connect(function(input) if not(input.UserInputType == Enum.UserInputType.Keyboard) then return end; if not(input.KeyCode == Enum.KeyCode.Slash) then return end; --code end);