local Plr = game.Players.LocalPlayer local PressurePlate = game.Workspace.SharesMachine.PressurePlate Plr:GetMouse().KeyDown:Connect(function(K) if K == "e" then if ________ then script.Parent.Visible = true else script.Parent.Visible = false end end end)
You would actually need to use a ServerScript as well in that. Here is my recommendation:
Setup (everything is very important):
Place this ServerScript inside the Pressure plate:
local PressurePlate = script.Parent local Remote = Instance.new('RemoteEvent', game.ReplicatedStorage) Remote.Name = "PadPressed" PressurePlate.Touched:Connect(function(hit) if game.Players:GetPlayerFromCharacter(hit.Parent) then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) Remote:FireClient(plr) end end)
Place this in a LocalScript that is the child of StarterGui:
local Remote = game.ReplicatedStorage:WaitForChild("PadPressed") local plr = game.Players.LocalPlayer Remote.OnClientEvent:Connect(function() plr:GetMouse().KeyDown:Connect(function(K) if K == "e" then --finish your event here end end) end)