Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local UIS = game:GetService("UserInputService")
- UIS.InputBegan:Connect(function(input,gameProcessed)
- if input.UserInputType == Enum.UserInputType.Keyboard then
- if input.KeyCode == Enum.KeyCode.E then
- if UIS:GetFocusedTextBox() == nil then
- for i,v in pairs(game.Workspace.NPCS:GetChildren()) do
- local mag = (v.LowerTorso.Position-game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude
- if mag <= 10 then
- for i = 1,0.8,-0.05 do
- wait()
- script.Parent.ImageColor3 = Color3.new(i,i,i)
- end
- wait()
- for i = 0.0,1,0.05 do
- wait()
- script.Parent.ImageColor3 = Color3.new(i,i,i)
- end
- v.NPCTalk:FireServer()
- end
- end
- end
- end
- end
- end)
- while wait() do
- script.Parent.Visible = false
- for i,v in pairs(game.Workspace.NPCS:GetChildren()) do
- local mag = (v.LowerTorso.Position-game.Players.LocalPlayer.Character.HumanoidRootPart.Position).Magnitude
- if mag <= 10 then
- local WSP = game.Workspace.CurrentCamera:WorldToScreenPoint(v.LowerTorso.Position)
- script.Parent.Visible = true
- script.Parent.Position = UDim2.new(0,WSP.X,0,WSP.Y)
- script.Parent.TextLabel.Text = "to chat with ..."..v.Name
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement