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

Does .Touched work in a LocalScript?

Asked by
wazap 100
10 years ago

I'm thinking of these 2 particular examples

Case 1. Local parts

local cam = workspace.CurrentCamera
local part = Instance.new("Part", cam)
part.Touched:connect(function() end)--Will this ever run?

Case 2. LocalScript inside a Tool

local tool = script.Parent
tool.Handle.Touched:connect(function() end) -- will this run

Normally I'd test both of these, but I can't access Studio for like, a week or 2, but I want to continue coding. Any ideas?

0
What's up with your Studio? hiccup111 231 — 10y
0
From personal experience the LocalPlayer CAN touch parts in the Camera, though no scripts can run there. Articulating 1335 — 10y
0
Well my laptop is down and I cant download studio on a public computer. I just use onedrive to script in word. But thanks wazap 100 — 10y

1 answer

Log in to vote
0
Answered by
HexC3D 830 Moderation Voter
10 years ago

Yes the local script will run, also if I answered your question but remember to state who hit do this

tool.Handle.Touched:connect(function(hit) -- Use hit.Parent , that will get the player mk.. 

end)

If I helped +1

Ad

Answer this question