Hey guys so I have a part that I’m using the .Touched event with in a script and a local script. But I need it inside the local script so that I can number 1 refer to the player with a localized variable and number 2, I need to fire a remote event from the local script when they touch the part, but nothing is printing when the Touched event connects inside the local script.
Also, the BasePart.Touched event fires on the server, so there is no need to have a LocalScript over a server script. The BasePart.Touched event also gives the other part which came in contact, so therefore you can use its parent and Players:GetPlayerFromCharacter to get the player.
local part = workspace.Part
part.Touched:Connect(function()
print('DBSVT')
end)
This can work as a local script if written like in the above, you would just need to place the script in a directory/parent it to an instance which allows for it to be executed (local scripts do not execute if parented to the workspace), for example; StarterPlayerScripts/StarterGui/StarterCharacterScripts etc.