Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why dose this script not work?

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

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)

2 comments

0

It didn't work...

0

are you using a local script? You need that put it in StarterGui

I think you need to learn functions...

4 comments

0

Like serousily

0

I KNOW WHAT FUNCTIONS ARE I ACEDENTLY PUT IT IN, GOSH FREKING CRITICS!

0

ITS GONE, HAPPY!?!?

0

Thank you.

This discussion is preserved as it was. New answers, comments, and votes are closed.