Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is my remote event not connecting when the part is touched?

So i need this remote event to connect so that the player can get the gui when they touch this part but its not firing or printing anything and there are no errors pls help

local blind = script.Parent
local re = game.ReplicatedStorage.RemoteEvent

blind.Touched:Connect(function(hit)
local human = hit.Parent:findFirstChild("Humanoid")
        if (human ~= nil) then
               
        
print("fired")
   re:FireServer()
end
end)

3 comments

0

Is this script local or a serverscript

0

local

0

make the script a serverscript and get the player to fire a client evetn

2 answers

So, what you need to do is:

Put it in a serverscript.

local blind = script.Parent
local re = game.ReplicatedStorage.RemoteEvent

blind.Touched:Connect(function(hit)
local human = hit.Parent:findFirstChild("Humanoid")
        if (human ~= nil) then
              local player = game.Players:GetPlayerfromCharacter(hit.Parent) --[[You have to get the player, not the Character or humanoid]]
              re:FireClient(player)
              print("fired")
end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.