Ad
Log in to vote
0

Equipped Event & Connect a function which will chat, help?

Asked by
Lopous 1
3 years ago

This is probably the most easiest questien, but I am a derp and have no knowledge of lua or scripting (yet).

Do anyone know how to this? Example I hold a sword (or any tool in general) and I press T and from my head it says like "T" (or any word).

0
You seriously should've learnt some basic lua first, but anyhow, since it is Christmas, I'll write a little something. Won't be a full script on what you're requesting. StoleYourClothes 105 — 3y
0
Yeh I know... I plan to, but I don't plan to be a scipter or ful time builder as I'm like 20 and need a life n such. Lopous 1 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Simply detects when the 'T' key on the keyboard has been pressed. This should give you a start, try testing this by inserting a LocalScript into StarterGui.

local UIS = game:GetService("UserInputService") -- grabs userinputservice

UIS.InputBegan:connect(function(input, _) -- recognizes input is being given
    if input.KeyCode == Enum.KeyCode.T then -- checks to see if the key pressed was the 'T' key
        print("T pressed") -- outputs to console (hit F9)
    end
end)
0
But the goal is to make it appear at my characer's head. Lopous 1 — 3y
0
You never gave an example of an attempt. Although, it's Christmas, I'll write it up for you in a bit, okay? StoleYourClothes 105 — 3y
0
I did check it out and it didn't appear in the chat or above my character's head and thanks. Lopous 1 — 3y
0
It's not supposed to. This was an example, as you didn't provide any attempted code. :c StoleYourClothes 105 — 3y
0
I know, sorry... but I explained what I wanted in the most detail I could manage. Lopous 1 — 3y
Ad

Answer this question