If this is a LocalScript inside Workspace, it would not work as LocalScripts do not work in Workspace.
If this is a normal script, you can’t use LocalPlayer on a normal script.
Also, when anything touches the part at all, you’re automatically assuming that the part that touched it is a player. I recommend checking if the part that touched it is a player before enabling the ScreenGui.
As I mentioned in my previous reply, You can’t use LocalPlayer on a normal script.
Try doing this:
local Players = game:GetService("Players")
local part = script.Parent -- Change to wherever your part is located
local function onTouched(part)
local player = Players:GetPlayerFromCharacter(part.Parent)
if player then
player.PlayerGui:WaitForChild("SpeechDarrelIntro").Enabled = true
end
end
part.Touched:Connect(onTouched)
-- Make sure "SpeechDarrelIntro" is a ScreenGui
I wrote this on a phone so I don’t expect it to work…
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.CharacterAdded:Wait()
character.ABodyPart.Touched:Connect(function(hit)
if hit.Name = "ThePartYouWantToBeTouch's Name" then
player.PlayerGui.SpeechDarrelIntro.Enabled = true
end
end