|
| 11 Aug 2012 03:56 AM |
Theres a missing end or a then? I cant find any! Heres the script:
plr = game.Players.LocalPlayer char = plr.Character guis = plr.PlayerGui scripts = script.Parent self = script sprinting = false running = false crouch = false prone = false visible = 4 audible = 0
repeat wait() until player
function on_walk(speed) if speed > 0 then moving = true else moving = false end end
function return_values() if not crouch and prone and sprinting then if moving then audible = 3 visible = 4 end elseif crouch and moving then audible = 2 visible = 3 elseif prone and moving then audible = 1 visible = 1 elseif sprinting then audible = 5 visible = 5 elseif crouch and moving==false then audible = 0 visible = 2 elseif prone and moving==false then audible = 0 visible = 0 else audible = 0 visible = 4 end return audible return visible end
while true do local a,v = return_values() script.Parent.Values.Audible.Value = a script.Parent.Values.Visible.Value = v wait(0.5) end
char.Humanoid.Running:connect(on_walk) |
|
|
| Report Abuse |
|
|
ThatThar
|
  |
| Joined: 09 Jul 2012 |
| Total Posts: 794 |
|
|
| 11 Aug 2012 03:58 AM |
plr = game.Players.LocalPlayer char = plr.Character guis = plr.PlayerGui scripts = script.Parent self = script sprinting = false running = false crouch = false prone = false visible = 4 audible = 0
repeat wait() until player
function on_walk(speed) if speed > 0 then moving = true else moving = false end end
function return_values() if not crouch and prone and sprinting then if moving then audible = 3 visible = 4 end elseif crouch and moving then audible = 2 visible = 3 elseif prone and moving then audible = 1 visible = 1 elseif sprinting then audible = 5 visible = 5 elseif crouch and moving==false then audible = 0 visible = 2 elseif prone and moving==false then audible = 0 visible = 0 else audible = 0 visible = 4 end return audible return visible end end
while true do local a,v = return_values() script.Parent.Values.Audible.Value = a script.Parent.Values.Visible.Value = v wait(0.5) end |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2012 03:59 AM |
You never ended off
function return_values() |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Aug 2012 04:00 AM |
| ThatThar's script fixed it |
|
|
| Report Abuse |
|
|
| |
|
ThatThar
|
  |
| Joined: 09 Jul 2012 |
| Total Posts: 794 |
|
|
| 11 Aug 2012 04:05 AM |
| What exactly does the output say? |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Aug 2012 04:08 AM |
| end expected to close function near return |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2012 04:09 AM |
Ok, I fixed errors, but now it doesnt work..
plr = game.Players.LocalPlayer char = plr.Character guis = plr.PlayerGui scripts = script.Parent self = script sprinting = false running = false crouch = false prone = false
repeat wait() until player
function on_walk(speed) if speed > 0 then moving = true else moving = false end end
function return_values() local audible = 0 local visible = 0 if not prone or crouch then if not moving then audible = 3 visible = 4 end elseif crouch and moving then audible = 2 visible = 3 elseif prone and moving then audible = 1 visible = 1 elseif sprinting then audible = 5 visible = 5 elseif crouch and moving==false then audible = 0 visible = 2 elseif prone and moving==false then audible = 0 visible = 0 else audible = 0 visible = 4 end return audible return visible end
while true do local a,v = return_values() script.Parent.Values.Audible.Value = a script.Parent.Values.Visible.Value = v wait(0.5) end
|
|
|
| Report Abuse |
|
|
|
| 11 Aug 2012 04:19 AM |
| Is this in a localscript, since you're using LocalPlayer? |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Aug 2012 06:29 AM |
| It'd be a lot more helpful if you gave us an output. If you have none, place "print"s among the script to see where it stops working. |
|
|
| Report Abuse |
|
|