#proximity prompt with tool
21 messages · Page 1 of 1 (latest)
thanks man
@crystal harness Were you able to fix the problem?
nah
i basically wanna make it so you can still click things if you’re holding a tool
because for some reason roblox makes it so you can’t click anything if you’re holding one
Wdym by that?
Like, the proximity prompts doesn't appear when holding a tool?
no, it doesn’t register clicks when you’re holding it
Oh
it does that with click detectors too
Yea, that's something Roblox does by default to make the click priority on the tool so instead of clicking other things it focuses on the tool
Idk tho if theres any way to disable that tho
I'm going home rn so imma check if theres anything that can disable this, alr?
alright thanks
** You are now Level 4! **
Hey, uhh
I wasn't able to make it work by creating a script since I found out that its something that its implemented on Roblox's engine that everytime you have a tool equipped, it will disable all click detectors or something like that
However, I found on devforum something about this and they marked a localscript (that is supposed to be put inside the tool) as "Solved" meaning I guess it should work?
I didn't test it tho to see if it actually fixes the problem, but here you go:
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Tool = script.Parent
print("This worked")
Tool.Activated:Connect(function()
local Target = Mouse.target
print("Part A")
if Target:FindFirstChildWhichIsA("ClickDetector") then
local CD = Target:FindFirstChildWhichIsA("ClickDetector")
print("Part B")
local Health = game.Workspace.SpecOps.Ten.Health
Health.Value = Health.Value - 10
Player.Spec_Ops_Infected.Score.Value = Player.Spec_Ops_Infected.Score.Value + 10
end
end)