|
| 27 Dec 2011 08:30 PM |
function onKEY(key) if key == ("e") then script.parent.Silencer.Transparency = 0 end
function onSelected(mouse) mouse.KeyDown:connect(onKEY) end
script.Parent.Selected:connect(onSelected) -----
Its a localscript inside a tool to make a brick within the tool become visible. However, when I test it, the script doesnt not work. What's wrong with it? ._. |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 Dec 2011 08:33 PM |
| I'm new to scripting, so I really dont understand the lingo that applies to it. I'm here to learn. ^_^ |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2011 08:36 PM |
view>Output press play Copy-paste output here
~Trappee?Trapper~ |
|
|
| Report Abuse |
|
|
pauljkl
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 9364 |
|
|
| 27 Dec 2011 08:37 PM |
| Doesnt parent need a capital? |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2011 08:40 PM |
function onKEY(key) if key == ("e") then script.Parent.Silencer.Transparency = 0 end function onSelected(mouse) mouse.KeyDown:connect(onKEY) end script.Parent.Selected:connect(onSelected)
Good eye Paul.
http://www.roblox.com/Part-Generator-Plugin-V3-item?id=68342522 |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2011 08:42 PM |
| Will the output show a script's data if its in the tool? Or does it need to be in a special space? |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2011 08:44 PM |
| (The capitalization did not fix the issue.) |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2011 08:47 PM |
I got this from the output:
Players.Player.Backpack.SMG.Silencer Toggle:10: 'end' expected (to close 'function' at line 1) near '(eof)' 21:45:11 - Players.Player.Backpack.SMG.Script:13: 'end' expected (to close 'if' at line 9) near '(eof)' 21:45:11 - Touched is not a valid member of Backpack
|
|
|
| Report Abuse |
|
|
|
| 27 Dec 2011 08:47 PM |
function onKEY(key) if key == ("e") then script.Parent.Silencer.Transparency = 0 end end function onSelected(mouse) mouse.KeyDown:connect(onKEY) end script.Parent.Selected:connect(onSelected)
http://www.roblox.com/Part-Generator-Plugin-V3-item?id=68342522 |
|
|
| Report Abuse |
|
|
pauljkl
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 9364 |
|
|
| 27 Dec 2011 08:48 PM |
Here, your end was missing
function onKEY(key) if key == ("e") then script.Parent.Silencer.Transparency = 0 end end function onSelected(mouse) mouse.KeyDown:connect(onKEY) end script.Parent.Selected:connect(onSelected)
|
|
|
| Report Abuse |
|
|
|
| 27 Dec 2011 08:49 PM |
Im somehwhat new but from what i know shouldnt it be
key: lower key == (whateverkeyhere) |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2011 08:49 PM |
Kinda close Ninja.
http://www.roblox.com/Part-Generator-Plugin-V3-item?id=68342522 |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2011 08:53 PM |
| Its still not working. Is it supposed to be a localscript or a script? More importantly, will this run in test mode on the editor, because thats what I'm working with to test. |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2011 08:57 PM |
| And if it means anything, its in a tool, not a Hopperbin. |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2011 09:07 PM |
**function onKEY(key) if key == ("e") then script.Parent.Silencer.Transparency = 0 end end function onSelected(mouse) mouse.KeyDown:connect(onKEY) end script.Parent.Equipped:connect(onSelected)**
http://www.roblox.com/Part-Generator-Plugin-V3-item?id=68342522 |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 Dec 2011 09:15 PM |
| As a final question, what would need to be added to get the key to work as a toggle? As in, only needing ONE key as an on/off feature. |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2011 09:34 PM |
| Doesn't that need a isOn = true/off line of something? |
|
|
| Report Abuse |
|
|
| |
|
|
| 28 Dec 2011 10:03 AM |
| Bump because this is actually going somewhere. ^_^ |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2011 10:17 AM |
You would add values....
local Transparent = true
script.Parent.Equipped:connect(function(Mouse)
Mouse.KeyDown:connect(function(Key)
if key == ("e") then
if Transparent script.Parent.Silencer.Transparency = 0 Transparent = false
else script.Parent.Silencer.Transparency = 1 Transparent = true end end end) end)
|
|
|
| Report Abuse |
|
|
|
| 28 Dec 2011 10:18 AM |
Sorry :l
local Transparent = true
script.Parent.Equipped:connect(function(Mouse)
Mouse.KeyDown:connect(function(Key)
if key == ("e") then
if Transparent then script.Parent.Silencer.Transparency = 0 Transparent = false
else script.Parent.Silencer.Transparency = 1 Transparent = true end end end) end) |
|
|
| Report Abuse |
|
|
ZDude2461
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 347 |
|
|
| 28 Dec 2011 10:18 AM |
function onKEY(key) key = key:lower() if key == ("e") then script.Parent.Silencer.Transparency = 0 end end
function onSelected(mouse) mouse.KeyDown:connect(function(key) onKEY end)) end
script.Parent.Selected:connect(onSelected) |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2011 10:25 AM |
I know what's wrong.
You forgot to put:
-- Made by legend8887 :) There, that will fix it. :)
function onKEY(key) if key == ("e") then script.parent.Silencer.Transparency = 0 end
function onSelected(mouse) mouse.KeyDown:connect(onKEY) end
script.Parent.Selected:connect(onSelected) |
|
|
| Report Abuse |
|
|