ClickDetector doesn't work when a tool is equipped

The title says it all , ClickDetector doesn’t work when a tool is equipped . This is my problem.

iirc I don’t think you can activate it while holding a tool, unless it’s in Properties (I often don’t use ClickDetector so idk if there is an option to do that, and I’m writing this on mobile). However you can try to use ProximityPrompt instead.

1 Like

when u hold a tool, click detector wont work because the tool can be activated

1 Like

Can i do smth like this ?

tool.Activated:Connect(function()
  local Target=mouse.Target
  if Target.Name=='Lock' and Target.Parent.Name=='Painting_099' then
    game:GetService'ReplicatedStorage'.Remotes.Locks.Painting_099:FireServer()
    game:GetService'ReplicatedStorage'.Remotes.Tool.destroyAllToolsFromAllPlrs:FireServer'KEY'
    script:Destroy()
  end
end)

But now my problem is that how can i make remotes secure enough so remotes will do nothing if an exploiter fires them ?

1 Like

spam if statements with to check if they have all the needs, to do something maybe

For the painting_099 remote i know i could just add a boolean that checks if a player is in the room . But for Destroy remote i don’t know what to check

can u send the part of destroy remote

local Remote=game:GetService'ReplicatedStorage'.Remotes.Tool.destroyAllToolsFromAllPlrs
Remote.OnServerEvent:Connect(function(plr,tool)
  assert(tool)
  for i,v in next,game:GetService'Players':GetPlayers() do
    local Backpack=v.Backpack
    local chr=v.Character or v.CharacterAdded:Wait()
    if Backpack:FindFirstChild(tool) then
      Backpack:FindFirstChild(tool):Destroy()
    elseif chr:FindFirstChild(tool) then
      chr:FindFirstChild(tool):Destroy()
    end
  end
end)

uh so when does this remote happen like when someone triggers something?

Can’t really say , i used this remote in a few rooms that requires removing a specified tool from players

i have a feeling this is a 1 - 4 player horror game?

Only 6 Players can play on each server so

so does it delete everyones or just 1 player

Use Mouse.Hit, and send that to the server which will then raycast.

It does delete the chosen tool from all players ,

Players are able to activate ClickDetectors even with tools out by holding Control, there might be a way to manually trigger that behavior

How? Can you please hrlp ? I’d be really glad if you do so

if u are on macbook, hold command and u can activate the detector ( im on mac, i just tested and it worked i held a tool i didnt even know that thx chedksi ), if ur on pc, hold control and u can activate the detector

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.