mouse.icon = CD.icon-- your icon
“mouse” is undefined, change it to “Mouse” instead
mouse.icon = CD.icon-- your icon
“mouse” is undefined, change it to “Mouse” instead
it wont let you click with the gun equipped because when your gun is equipped and you click it is supposed to shoot so that’s why you can’t click click detectors
try what he did!!!
but if you use mouse.Target
it just might work
This is the localscript inside of the tool. It doesn’t even go through Part A.
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Tool = script.Parent
Tool.Activated:Connect(function()
local Target = Mouse.Target
print("Part A")
if Target:FindFirstChildWhichIsA("ClickDetector") then
local CD = Target:FindFirstChildWhichIsA("ClickDetector")
print("Part B")
Mouse.icon = CD.icon
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)
try making the *Target “T” to lower case
Try capitalizing the i
in that line.
did it work???
That didn’t work., it seems to be before the first print statement.
how about you skip the icon part delete all the icon parts or just re-copy my script
I fixed it!
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)
i am to lazy to see what changed what was the problem???
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
Mouse.Button1Down:connect(function()
if Mouse.Target == workspace.Part then
print(“f”)
end
end)
Sorry if this doesn’t work I didn’t write this in roblox studio this should somewhat work. The Capilization could be wrong.
he already solved his problem it
Oh I didn’t saw that because he didn’t mark it as solved Sorry.
so it was the lower case “t” in target?
what was the problem please answer
can you please tell us the answer