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

"Clicked is not a function of LocalScript"?

Asked by 9 years ago

How would I fix that in a LocalScript? Like in this line:

Line: pospoints = script.Clicked.Value

(Clicked is a number value that is a child of the script)

0
you should rename it to something else. And let me see the entire script. One line isnt enough. TrollD3 105 — 9y
0
Kind of a really, really long script, but ok CoolJohnnyboy 121 — 9y
0
Check your ROBLOX messages, I sent you the script CoolJohnnyboy 121 — 9y

3 answers

Log in to vote
0
Answered by
Vezious 310 Moderation Voter
9 years ago

All You Have to do is change the number value. It's getting it confused with function. Try making it lowercase, clicked.

0
Oh, ok. CoolJohnnyboy 121 — 9y
0
It still isn't working. It is still giving me the same output on the developer console CoolJohnnyboy 121 — 9y
0
Change it's name? Vezious 310 — 9y
0
it wouldn't let me send you the script on roblox, but the script is posted as an answer on this thread CoolJohnnyboy 121 — 9y
0
I'm sorry, if you say the output states that, and you've changed the name, and the output still is the same, I can't help you. because there is no possible way the output error can be the same. Vezious 310 — 9y
Ad
Log in to vote
0
Answered by 9 years ago
script.C.Value

(Change the number value's name to C)

0
that still didn't work, i will post the script in an answer on this thread CoolJohnnyboy 121 — 9y
0
try MouseButton1Click haloelite27 25 — 8y
Log in to vote
0
Answered by 9 years ago
pospoints = script.hi.Value

local inactive = false

function roundedPos(pos)
    local x = math.floor(pos.x)
    local y = math.floor(pos.y)
    local z = math.floor(pos.z)

    return Vector3.new(x, y, z)
end

function b1(mouse)
local m1 = mouse.Hit.p
pt1 = roundedPos(m1)
local e = Instance.new("Part")
local me = Instance.new("CylinderMesh")
me.Parent = e
e.Parent = game.Workspace
e.formFactor = "Custom"
e.Position = pt1
e.Size = Vector3.new(2, .2, 2)
e.BrickColor = BrickColor.New("Bright yellow")
e.Anchored = true
e.Transparency = .2
script.e1.Value = e
pospoints = 1
end

function b2(mouse)
local m2 = mouse.Hit.p
pt2 = roundedPos(m2)
local e = Instance.new("Part")
local me = Instance.new("CylinderMesh")
me.Parent = e
e.Parent = game.Workspace
e.formFactor = "Custom"
e.Position = pt2
e.Size = Vector3.new(2, .2, 2)
e.BrickColor = BrickColor.New("Bright yellow")
e.Anchored = true
e.Transparency = .2
script.e2.Value = e
pospoints = 2
end

function b3(mouse)
inactive = true
local m3 = mouse.Hit.p
local pt3 = roundedPos(m3)
local e = Instance.new("Part")
local me = Instance.new("CylinderMesh")
me.Parent = e
e.Parent = game.Workspace
e.formFactor = "Custom"
e.Position = pt3
e.Size = Vector3.new(2, .2, 2)
e.BrickColor = BrickColor.New("Bright yellow")
e.Anchored = true
e.Transparency = .2
script.e3.Value = e
wait(1)
script.e1.Value:remove()
script.e2.Value:remove()
script.e3.Value:remove()
pospoints = 0
local n = Instance.new("Part")
n.Parent = game.Workspace
n.Position = pt1 + Vector3.new(0, 200, 0)
n.formFactor = "Custom"
n.Size = Vector3.new(0.6, 0.6, 2)
n.CFrame = n.CFrame * CFrame.fromEulerAnglesXYZ(4.65, 0, 0)
n.Name = "Mortar Missle"
local m = Instance.new("SpecialMesh")
m.Parent = n
m.MeshType = "FileMesh"
m.MeshId = "http://www.roblox.com/asset/?id=29932049"
m.TextureId = "http://www.roblox.com/asset/?id=2022906"
m.Scale = Vector3.new(1, 1, 1)
local s = Instance.new("Sound")
s.SoundId = "http://roblox.com/asset/?id=10209859"
s.Parent = n
s.Name = "MortarExplode"
s.Pitch = .2
s.Volume = 1
local sc = script.MortarBoom:clone()
sc.Disabled = false
sc.Parent = n
s.PlayOnRemove = true
wait(2)
local n = Instance.new("Part")
n.Parent = game.Workspace
n.Position = pt2 + Vector3.new(0, 200, 0)
n.formFactor = "Custom"
n.Size = Vector3.new(0.6, 0.6, 2)
n.CFrame = n.CFrame * CFrame.fromEulerAnglesXYZ(4.65, 0, 0)
n.Name = "Mortar Missle"
local m = Instance.new("SpecialMesh")
m.Parent = n
m.MeshType = "FileMesh"
        m.MeshId = "http://www.roblox.com/asset/?id=29932049"
        m.TextureId = "http://www.roblox.com/asset/?id=2022906"
        m.Scale = Vector3.new(1, 1, 1)
        local s = Instance.new("Sound")
        s.SoundId = "http://roblox.com/asset/?id=10209859"
        s.Parent = n
        s.Name = "MortarExplode"
        s.Pitch = .2
        s.Volume = 1
        local sc = script.MortarBoom:clone()
        sc.Disabled = false
        sc.Parent = n
        s.PlayOnRemove = true
        wait(2)
        local n = Instance.new("Part")
        n.Parent = game.Workspace
        n.Position = pt3 + Vector3.new(0, 200, 0)
        n.formFactor = "Custom"
        n.Size = Vector3.new(0.6, 0.6, 2)
        n.CFrame = n.CFrame * CFrame.fromEulerAnglesXYZ(4.65, 0, 0)
        n.Name = "Mortar Missle"
        local m = Instance.new("SpecialMesh")
        m.Parent = n
        m.MeshType = "FileMesh"
        m.MeshId = "http://www.roblox.com/asset/?id=29932049"
        m.TextureId = "http://www.roblox.com/asset/?id=2022906"
        m.Scale = Vector3.new(1, 1, 1)
        local s = Instance.new("Sound")
        s.SoundId = "http://roblox.com/asset/?id=10209859"
        s.Parent = n
        s.Name = "MortarExplode"
        s.Pitch = .2
        s.Volume = 1
        local sc = script.MortarBoom:clone()
        sc.Disabled = false
        sc.Parent = n
        s.PlayOnRemove = true
        wait(2)
script.Parent:remove()
end

function onButton1Down(mouse)
    if inactive then return end
    if pospoints == 0 then return b1(mouse) end
    if pospoints == 1 then return b2(mouse) end
    if pospoints == 2 then return b3(mouse) end
end

function onSelected(mouse)
    mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

script.Parent.Selected:connect(onSelected)

Answer this question