in a game i am trying to create i want to fire a function when a player is on a specific part however the two bits of code i am using work fine on there own but when i put them together it breaks can any tell me what i am doing wrong please
here is my code:
local player = game.Players.LocalPlayer local mouse = player:GetMouse()
Music = script.Sound
script.Parent.Touched:connect(function(hit)
mouse.KeyDown:connect(function(key)
if key == "e" then
print("test")
end
end)
end)

1 comment
isnt UserinputService for local scripts?