I can't get a Touch Event in a Local Script!

In the following image what I want to do is to try that when I touch the black block then the one above (Arrow) is Transparency = 1 (So that it is not seen)

Screenshot_34

With this Local Script…

Screenshot_35

The problem is that he won’t let me call him. What can I do, who can help me?

3 Likes

You can’t run local scripts inside workspace. Put it inside StarterCharacterScripts or StarterGui or StarterPack instead

Already tried but it doesn’t work. Try with “ServerScriptService”, “ServerStorage”, “StarterGui”, “StarterPack”, “StarterPlayer”

if you used same script it still won’t work. You can put localscript inside StarterCharacterScripts and do this:

local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")

humanoid.Touched:Connect(function(hit)
    if hit.Name == "Part" then
        print("Character touched to Part")
    end
end)

^ this is just an example

14 Likes

Oh Thanks! Thanks!!! You Are the best!

4 Likes