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

ClickDetector not working?

Asked by 9 years ago
debounce = false
script.Parent.Button.ClickDetector.MouseClick:connect(function()
    print('Clicked')
    if debounce == false then
        print('wat')
        debounce = true
        script.Parent.Button.BrickColor=BrickColor.new("Bright red")
        local part = Instance.new("Part",workspace.PartStorage)
        local mesh = Instance.new("FileMesh", part)
        mesh.MeshId = script.Parent.Mesh.Value
        mesh.TextureId = script.Parent.Texture.Value
        mesh.Scale = Vector3.new(.65, .65, .65)
        local cash = Instance.new("IntValue",part)
        cash.Name = "Cash"
        cash.Value = 1
        part.CFrame = script.Parent.Drop.CFrame
        part.Size=Vector3.new(.6,.6,.6)
        game.Debris:AddItem(part,10)
        wait(1.1) -- Time to wait in between clicks
        debounce = false
        script.Parent.Button.BrickColor=BrickColor.new("Lime green")
    end
end)

The event isn't calling, so the output isn't printing anything I have FilteringEnabled on, how do I make this work?

0
Put a random print before 'debounce = false' tell me if that at least prints. DigitalVeer 1473 — 9y
0
Yeah it does, and that's the only code in the script as well CardboardRocks 215 — 9y
0
Put this at the top of the script and tell me what prints: 'print(script.Parent.Button:FindFirstChild("ClickDetector") and "Yep!" or "Yoohoo!")' DigitalVeer 1473 — 9y
0
It finds it and everything, the mouseClick part just isn't firing CardboardRocks 215 — 9y
0
FilteringEnabled won't update the server when the client does something, therefore anything the client does to the server doesn't run. You may have to deal with Clicking The Brick Via LocalScript & RemoteFunctions. If you need help with this, please let me know. DigitalVeer 1473 — 9y

Answer this question