Righty, so I've encountered a little problem while trying to script a.. simple, as I thought, thing. Keep in mind, however: I am not just a beginning scripter; I've began like... about a week ago; so if the mistake is obvious, I ask you not to be too harsh. Now here is the code that I am using (it's a LocalScript)
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local openDoor = game:GetService("UserInputService")
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
if Mouse.Target then
openDoor:FireServer(Mouse.Target)
end
end
end)
local peeking = false
while true do
wait()
if Mouse.Target == workspace.Door then
if peeking == false then
peeking = true
local bClone = script.Parent.Button:Clone()
bClone.Parent = workspace.CurrentCamera
bClone.Adornee = workspace.Door
bClone.TextLabel.Visible = true
end
else
if peeking == true then
if workspace.CurrentCamera:FindFirstChild("Button") then
workspace.CurrentCamera.Button:remove()
peeking = false
end
end
end
end
And here is the problem: When pressing "E" on the supposed door, the door does not react and an error pops up in the console, stating: "FireServer is not a valid member of UserInputService "Instance" "
How can I fix this, if a fix is possible?
