Problem with my tool - Printable Version +- 2DWorlds Forums (http://2dworlds.buildism.net/forum) +-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4) +--- Forum: Scripting (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=13) +--- Thread: Problem with my tool (/showthread.php?tid=4831) |
Problem with my tool - Duck - 05-21-2011 -- I don't get any output Tool = script.Parent function Change© if C == p then if Tool.Parent.Parent.Character.Body.Layer ~= 0 then Tool.Parent.Parent.Character.Body.Layer = Tool.Parent.Character.Body.Layer-1 end elseif C == l then if Tool.Parent.Parent.Character.Body.Layer ~= 2 then Tool.Parent.Parent.Character.Body.Layer = Tool.Parent.Character.Body.Layer+1 end end end link(Tool.KeyDown, Change) RE: Problem with my tool - noob007 - 05-22-2011 What's with the copyright symbol? RE: Problem with my tool - Jacob__mybb_import1 - 05-22-2011 I got an error when I tried to use it, you're missing a "Parent" in both long lines. Also, variables are case sensitive (so you need a lowercase or capital C everywhere, not both) and you have to put strings (letters, sentences, or words) in quotes or Lua will think you're trying to use a variable. [lua] Tool = script.Parent function Change© if c == "p" then if Tool.Parent.Parent.Character.Body.Layer ~= 0 then Tool.Parent.Parent.Character.Body.Layer = Tool.Parent.Parent.Character.Body.Layer-1 end elseif c == "l" then if Tool.Parent.Parent.Character.Body.Layer ~= 2 then Tool.Parent.Parent.Character.Body.Layer = Tool.Parent.Parent.Character.Body.Layer+1 end end end link(Tool.KeyDown, Change) [/lua] RE: Problem with my tool - Duck - 06-03-2011 (05-22-2011, 08:10 PM)noob007 Wrote: What's with the copyright symbol? Apparently the forums change ( c ) into © |