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

Mouse Click a userdata value?

Asked by 8 years ago

Ok so Im trying to make a tycoon how can I make it that when a player presses this button parts drop from where I told them to well everytime I try this How could I fix this?

script.Parent.ClickDetector.MouseClick(function()
    local DropperFree = game.Workspace.Dropper1.Dropper
    local newParts = Instance.new("Part")
    newParts.Name = "Drops"
    newParts.Parent = game.Workspace
    newParts.Position = DropperFree.Position







end)

it gives me in output Workspace.Part.Script:1: attempt to call field 'MouseClick' (a userdata value)

1 answer

Log in to vote
-1
Answered by 8 years ago

You didn't connect it to the function.

script.Parent.ClickDetector.MouseClick:connect(function() -- Right here.
    local DropperFree = game.Workspace.Dropper1.Dropper
    local newParts = Instance.new("Part")
    newParts.Name = "Drops"
    newParts.Parent = game.Workspace
    newParts.Position = DropperFree.Position







end)

0
My fault ive been doing that lately thanks a lot my simple mistake reputation for you johndeer2233 439 — 8y
Ad

Answer this question