The basic script, that when the NPC is Clicked I would like an outline I have unioned together around the NPC to appear; specifically I'd love a more fleshed out system so I can animate the NPC to wave and the box will stick to his hand... But I am not that advanced so this would do, but I can't seem to get it to work and it isn't giving an error at all?
I have no clue how to use DataStore, so using ServerScript service and adding all NPC's to a folder would be amazing It was supposed to be a E, to interact to talk; but select the npc with a click detector which would load the visibility force an animation (the player walking up to the npc) and then proceed to give options to talk to said npc whilst he runs through animations or whatever...
Thank you so much for your efforts in advanced, if anyone would like to join a group project with me and learn together I am down for that! Take care and thanks in advanced!
local npc = script.Parent.Parent
local SelectedVal = Instance.new("BoolValue")
SelectedVal.Name = "SelectedVal"
SelectedVal.Parent = npc.Selected
Selected = npc.Selected:GetDescendants()
local ClickDetector = Instance.new("ClickDetector")
ClickDetector.Parent = npc.HighlightScript
if SelectedVal == true then
Selected.Transparency = 0
elseif SelectedVal == false then
Selected.Transparency = 1
local function OnClick(player)
if ClickDetector.MouseHoverEnter == true then
Selected.OutlineFloor.Transparency = 0
elseif ClickDetector.MouseClick == true then
Selected.OutlineBody = 1
end
script.Parent.ClickDetector.MouseClick:connect(OnClick)
end
end

1 comment
On line 16 and 18 you're checking if events equal true. Thats not how you do it. Make a boolean variable, and swap it whenever the clickdetector is clicked instead.