#User input help

1 messages · Page 1 of 1 (latest)

keen moss
#

I want to add a e to open when you get near a part but right now i cant seem to add it with it working. i have tried many different ways and none works.

Local script is inside starterPlayer - starterPlayerScripts

crude sundial
#

@keen moss Can you explain what you mean by ''get a e to open when you get near it'

errant estuaryBOT
#

studio** You are now Level 6! **studio

keen moss
crude sundial
#

oh thats simple

#

you'd js do

#
local UserInputService = game:GetService("UserInputService")

local PartToBeNear = workspace.Part

UserInputService.InputBegan:Connect(function(Input)
    if Input.KeyCode == Enum.KeyCode.E then
        if  (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - PartToBeNear.Position).Magnitude <= 10 then
            --open the shop ect
        end
    end
end)

@keen moss