Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

"Clicked is not a function of LocalScript"?

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)

3 comments

0

you should rename it to something else. And let me see the entire script. One line isnt enough.

0

Kind of a really, really long script, but ok

0

Check your ROBLOX messages, I sent you the script

3 answers

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

5 comments

0

Oh, ok.

0

It still isn't working. It is still giving me the same output on the developer console

0

Change it's name?

0

it wouldn't let me send you the script on roblox, but the script is posted as an answer on this thread

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.

script.C.Value

(Change the number value's name to C)

2 comments

0

that still didn't work, i will post the script in an answer on this thread

0

try MouseButton1Click

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.