Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-4

Attempt to call global? [closed]

Asked by 9 years ago
--Labels
left = game.Workspace.Left
Left = game.Workspace.Left
OntouchedL = game.Workspace.Left.Touched
right = game.Workspace.Right
Right = game.Workspace.Right
OntouchedR = game.Workspace.Right.Touched
JunctionOffice = game.Workspace.JO
Brandate = game.Workspace.BD
MetroPoint = game.Workspace.MP
OntouchedJO = game.Workspace.JO.Touched
OntouchedBD = game.Workspace.BD.Touched
OntouchedMP = game.Workspace.MP.Touched
MPBound = game.Workspace.MPBound
JOBound = game.Workspace.JOBound
OntouchedMPB = game.Workspace.MPBound.Touched
OntouchedJOB = game.Workspace.JOBound.Touched

---------------------------------------------------------
--Functions
function Blink()
    if OntouchedL(Left) then
        script.Parent.Parent.Right.DOTS.DOTS1.Blink.Disabled = true
        script.Parent.Parent.Right.DOTS.DOTS2.Blink.Disabled = true
        script.Parent.Parent.Left.DOTS.DOTS1.Blink.Disabled = false
        script.Parent.Parent.Left.DOTS.DOTS2.Blink.Disabled = false
    end
    if OntouchedR(Right) then
        script.Parent.Parent.Right.DOTS.DOTS1.Blink.Disabled = true
        script.Parent.Parent.Right.DOTS.DOTS2.Blink.Disabled = true
        script.Parent.Parent.Left.DOTS.DOTS1.Blink.Disabled = false
        script.Parent.Parent.Left.DOTS.DOTS2.Blink.Disabled = false
    end
end

function Station()
    if OntouchedJO(JunctionOffice)then
        script.Parent.Parent.Right.Station.JO.Script.Disabled = false
        script.Parent.Parent.Right.Station.BD.script.Disabled = true
        script.Parent.Parent.Right.Station.MP.Script.Disabled = true
    end
    if OntouchedBD(Brandate)then
        script.Parent.Parent.Right.Station.JO.Script.Disabled = true
        script.Parent.Parent.Right.Station.BD.script.Disabled = false
        script.Parent.Parent.Right.Station.MP.Script.Disabled = true
    end
    if OntouchedMP(MetroPoint)then
        script.Parent.Parent.Right.Station.JO.Script.Disabled = true
        script.Parent.Parent.Right.Station.BD.script.Disabled = true
        script.Parent.Parent.Right.Station.MP.Script.Disabled = false
    end
end

function Terminal()
    if OntouchedMPB (MPBound)then
        script.Parent.Parent.Right.Bounds.MPBound1.BrickColor = BrickColor.new("New Yeller")
        script.Parent.Parent.Right.Bounds.MPBound2.BrickColor = BrickColor.new("New Yeller")
        script.Parent.Parent.Left.Bounds.JOBound1.BrickColor = BrickColor.new("Medium stone grey")
        script.Parent.Parent.Left.Bounds.JOBound2.BrickColor = BrickColor.new("Medium stone grey")
    end
    if OntouchedJOB(JOBound)then
        script.Parent.Parent.Right.Bounds.MPBound1.BrickColor = BrickColor.new("Medium stone grey")
        script.Parent.Parent.Right.Bounds.MPBound2.BrickColor = BrickColor.new("Medium stone grey")
        script.Parent.Parent.Left.Bounds.MPBound1.BrickColor = BrickColor.new("New Yeller")
        script.Parent.Parent.Left.Bounds.MPBound2.BrickColor = BrickColor.new("New Yeller")
    end
end

---------------------------------------------------------------------------------
--Connection
script.Parent.Touched:connect(Blink)
script.Parent.Touched:connect(Station)
script.Parent.Touched:connect(Terminal)

I was working on a Dynamic Route Map Display for my friend but the output said (ignore the timings)

"17:21:34.956 - Workspace.DRMD.DRMDSensor.Master:55: attempt to call global 'OntouchedMPB' (a userdata value) 17:21:34.957 - Stack Begin 17:21:34.957 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 55 17:21:34.958 - Stack End 17:21:34.959 - Workspace.DRMD.DRMDSensor.Master:37: attempt to call global 'OntouchedJO' (a userdata value) 17:21:34.960 - Stack Begin 17:21:34.961 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 37 17:21:34.961 - Stack End 17:21:35.907 - Workspace.DRMD.DRMDSensor.Master:55: attempt to call global 'OntouchedMPB' (a userdata value) 17:21:35.909 - Stack Begin 17:21:35.909 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 55 17:21:35.910 - Stack End 17:21:35.911 - Workspace.DRMD.DRMDSensor.Master:37: attempt to call global 'OntouchedJO' (a userdata value) 17:21:35.912 - Stack Begin 17:21:35.913 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 37 17:21:35.913 - Stack End 17:21:36.032 - Workspace.DRMD.DRMDSensor.Master:55: attempt to call global 'OntouchedMPB' (a userdata value) 17:21:36.033 - Stack Begin 17:21:36.033 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 55 17:21:36.034 - Stack End 17:21:36.035 - Workspace.DRMD.DRMDSensor.Master:37: attempt to call global 'OntouchedJO' (a userdata value) 17:21:36.036 - Stack Begin 17:21:36.036 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 37 17:21:36.037 - Stack End 17:21:47.247 - Workspace.DRMD.DRMDSensor.Master:55: attempt to call global 'OntouchedMPB' (a userdata value) 17:21:47.248 - Stack Begin 17:21:47.249 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 55 17:21:47.250 - Stack End 17:21:47.251 - Workspace.DRMD.DRMDSensor.Master:37: attempt to call global 'OntouchedJO' (a userdata value) 17:21:47.252 - Stack Begin 17:21:47.252 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 37 17:21:47.253 - Stack End 17:21:47.278 - Workspace.DRMD.DRMDSensor.Master:55: attempt to call global 'OntouchedMPB' (a userdata value) 17:21:47.279 - Stack Begin 17:21:47.281 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 55 17:21:47.282 - Stack End 17:21:47.283 - Workspace.DRMD.DRMDSensor.Master:37: attempt to call global 'OntouchedJO' (a userdata value) 17:21:47.283 - Stack Begin 17:21:47.284 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 37 17:21:47.285 - Stack End 17:21:54.339 - Workspace.DRMD.DRMDSensor.Master:55: attempt to call global 'OntouchedMPB' (a userdata value) 17:21:54.340 - Stack Begin 17:21:54.341 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 55 17:21:54.341 - Stack End 17:21:54.341 - Workspace.DRMD.DRMDSensor.Master:37: attempt to call global 'OntouchedJO' (a userdata value) 17:21:54.342 - Stack Begin 17:21:54.343 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 37 17:21:54.344 - Stack End 17:22:05.984 - Workspace.DRMD.DRMDSensor.Master:55: attempt to call global 'OntouchedMPB' (a userdata value) 17:22:05.985 - Stack Begin 17:22:05.986 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 55 17:22:05.987 - Stack End 17:22:05.989 - Workspace.DRMD.DRMDSensor.Master:37: attempt to call global 'OntouchedJO' (a userdata value) 17:22:05.990 - Stack Begin 17:22:05.990 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 37 17:22:05.990 - Stack End 17:22:13.681 - Workspace.DRMD.DRMDSensor.Master:55: attempt to call global 'OntouchedMPB' (a userdata value) 17:22:13.683 - Stack Begin 17:22:13.684 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 55 17:22:13.686 - Stack End 17:22:13.686 - Workspace.DRMD.DRMDSensor.Master:37: attempt to call global 'OntouchedJO' (a userdata value) 17:22:13.687 - Stack Begin 17:22:13.689 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 37 17:22:13.689 - Stack End 17:22:14.645 - Workspace.DRMD.DRMDSensor.Master:55: attempt to call global 'OntouchedMPB' (a userdata value) 17:22:14.646 - Stack Begin 17:22:14.647 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 55 17:22:14.648 - Stack End 17:22:14.650 - Workspace.DRMD.DRMDSensor.Master:37: attempt to call global 'OntouchedJO' (a userdata value) 17:22:14.651 - Stack Begin 17:22:14.651 - Script 'Workspace.DRMD.DRMDSensor.Master', Line 37 17:22:14.652 - Stack End"

0
What exactly is the problem be specific. 262187 45 — 9y
0
the output said "Workspace.DRMD.DRMDSensor.Master:55: attempt to call global 'OntouchedJO' (a user data value)" Smrtcircleline12 -5 — 9y

Closed as Non-Descriptive by Goulstem

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?