So, I feel kind of embarrassed for not knowing how to fix this or how to even do it correctly in the first place, but what I'm trying to do is make a script enabled when the player touches a part. This is in a local script.
1 | local plr = game.Players.LocalPlayer |
2 | local name = plr.Name |
3 |
4 | script.Parent.Touched:Connect( function (hit) |
5 | if hit.Parent.Name = = name then |
6 | plr.PlayerGui.ArmorShopOwner.Frame.TextLabel.NPCTalk.Disabled = false |
7 | end |
8 | end ) |
Local Scripts don't work in the Workspace. You'll have to put it under StarterPlayer > StarterPlayerScripts. Here's a modified version of your script
1 | local plr = game.Players.LocalPlayer |
2 | local name = plr.Name |
3 | game.Workspace. "PUT YOUR PART'S LOCATION HERE" .Touched:Connect( function (hit) |
4 | if hit.Parent.Name = = name then |
5 | plr.PlayerGui.ArmorShopOwner.Frame.TextLabel.NPCTalk.Disabled = false |
6 | end |
7 | end ) |
Please accept as an answer if it works :) If you have any trouble just leave a comment and I'll do my best to further help.