Problem with my tool
#1
-- I don't get any output Sad

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)
Reply
#2
What's with the copyright symbol?
Reply
#3
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]
Reply
#4
(05-22-2011, 08:10 PM)noob007 Wrote: What's with the copyright symbol?

Apparently the forums change ( c ) into ©
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)