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

Why dose this script not work?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

Here is the script...

function onKeyDown(Key) if Key=="k" then Game.Player.Humanoid.Health = 0 end end

Can some one fix this script please? And maybe tell my why it's didn't work?

2 answers

Log in to vote
0
Answered by 10 years ago

Seriously, do you know what functions are? This functions means nothing because is NOT called. For this script works you need to connect on the key event typed, use this at the end of your code:

local thePlayer = game.Players.LocalPlayer
local theInputs = thePlayer:GetMouse()
theInputs.KeyDown:connect(onKeyDown)
0
It didn't work... masterhalo55 75 — 10y
0
are you using a local script? You need that put it in StarterGui alessandro112 161 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

I think you need to learn functions...

0
Like serousily Operation_Meme 890 — 10y
0
I KNOW WHAT FUNCTIONS ARE I ACEDENTLY PUT IT IN, GOSH FREKING CRITICS! masterhalo55 75 — 10y
0
ITS GONE, HAPPY!?!? masterhalo55 75 — 10y
0
Thank you. Operation_Meme 890 — 10y

Answer this question