|
| 25 Jan 2014 05:53 PM |
Hello, ROBLOXians. Thank you very much for reading this line of text. Please, I've tried very hard to make this and it is not working. I am a Lua student, so please expect things wrong.
function onKeyDown(q)
if game.Players.Player1 == true then game.Workspace.Player1.Humanoid:Remove() wait(10) game.Workspace.Player1.Head.BrickColor = BrickColor.new("Really Black") game.Workspace.Player1.Head.Mesh:Remove() local m = Instance.new("Message") msg.Text = "PLAYER(Player1) was killed by *^&%#$" wait(3) msg:Remove() end end
mouse.KeyDown:connect(onKeyDown)
It says
- Workspace.Script:17: attempt to index global 'mouse' (a nil value)
It does that for everything I make.. It's very frustrating!! Thanks for the help. |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Jan 2014 05:56 PM |
Hi, I haven't played Roblox for years, but I know how to program.
Is this your whole script? On the last line you posted mouse.KeyDown:connect(onKeyDown) you use the variable "mouse" which hasn't been defined anywhere. Your script doesn't know what the word "mouse" means in that context |
|
|
| Report Abuse |
|
|
lolb3
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 2268 |
|
|
| 25 Jan 2014 05:56 PM |
did you define mouse? and don't do if game.Players.Player1 == true tjem do if game.Players["Player1"] then removing the humanoid won't kill, and you can't get a mouse without a local environment |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Jan 2014 06:02 PM |
| Okay, I didn't define mouse, sorry about that. And I name dit Kill Script by accident. It is supposed to remove the humanoid, making the player just fall and not be able to do anything. Sorry about that. And I'll change the script.. Thank you! Umm.. How do you define "Mouse"? |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Jan 2014 06:07 PM |
| No, I mean what are you supposed to put mouse =? |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2014 06:08 PM |
| Depends on the context. Where is this script? Tool? Hopperbin? Ect |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Jan 2014 06:12 PM |
player =game.Players.Playername Mouse = player:GetMouse() Mouse.KeyDown:connect(function(key) if key == "q" then Dostuffhere end end) |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2014 06:14 PM |
| GetMouse() is a thing?! cool! |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Jan 2014 06:17 PM |
| Thank you so much everyone! You really helped a lot. |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2014 06:19 PM |
Glad to help @the forum name :P |
|
|
| Report Abuse |
|
|