this is the client script:
local workerman = game.Workspace.workerman
local camera = workspace.CurrentCamera
local opensidemenu = script.Parent.Parent.Menu.OpenSideMenu
workerman.Torso.ActivateDialogue.Triggered:Connect(function()
camera.CameraType = Enum.CameraType.Scriptable
camera.FieldOfView = 50
opensidemenu.Visible = false
camera.CFrame = game.Workspace:WaitForChild("CameraPart2").CFrame
script.Parent.Opening.Position = UDim2.new(0.017, 0,0.128, 0)
workerman.Torso.ActivateDialogue.Enabled = false
script.Parent.Opening.TextButton.MouseButton1Down:Connect(function()
script.Parent.Opening.Position = UDim2.new(-4,-4,-4,-4)
script.Parent.Menu.Position = UDim2.new(0.017, 0,0.128, 0)
script.Parent.Parent.Menu.Sidebar.Confirm:Play()
script.Parent.Menu.Option1.MouseButton1Down:Connect(function()
script.Parent.Parent.Menu.Sidebar.Confirm:Play()
game.ReplicatedStorage.WorkerEvent:FireServer("Option1")
script.Parent.Parent.Menu.Sidebar.Confirm:Play()
script.Parent.ClosingAlt.Position = UDim2.new(0.017, 0,0.128, 0)
script.Parent.Menu.Position = UDim2.new(-4,-4,-4,-4)
end)
script.Parent.Menu.Option2.MouseButton1Down:Connect(function()
script.Parent.Parent.Menu.Sidebar.Confirm:Play()
game.ReplicatedStorage.WorkerEvent:FireServer("Option2")
script.Parent.Parent.Menu.Sidebar.Confirm:Play()
script.Parent.ClosingAlt.Position = UDim2.new(0.017, 0,0.128, 0)
script.Parent.Menu.Position = UDim2.new(-4,-4,-4,-4)
end)
script.Parent.Menu.Option3.MouseButton1Down:Connect(function()
script.Parent.Parent.Menu.Sidebar.Confirm:Play()
game.ReplicatedStorage.WorkerEvent:FireServer("Option3")
script.Parent.Parent.Menu.Sidebar.Confirm:Play()
script.Parent.ClosingAlt.Position = UDim2.new(0.017, 0,0.128, 0)
script.Parent.Menu.Position = UDim2.new(-4,-4,-4,-4)
end)
script.Parent.Menu.Exit.MouseButton1Click:Connect(function()
script.Parent.Menu.Position = UDim2.new(-4,-4,-4,-4)
script.Parent.Closing.Position = UDim2.new(0.017, 0,0.128, 0)
script.Parent.Parent.Menu.Sidebar.Confirm:Play()
end)
script.Parent.Closing.TextButton.MouseButton1Click:Connect(function()
script.Parent.Parent.Menu.Sidebar.Confirm:Play()
camera.FieldOfView = 75
camera.CameraType = Enum.CameraType.Custom
opensidemenu.Visible = true
game.Workspace.workerman.Torso.ActivateDialogue.Enabled = true
script.Parent.Closing.Position = UDim2.new(-4,-4,-4,-4)
end)
script.Parent.ClosingAlt.TextButton.MouseButton1Click:Connect(function()
script.Parent.Parent.Menu.Sidebar.Confirm:Play()
camera.FieldOfView = 75
camera.CameraType = Enum.CameraType.Custom
opensidemenu.Visible = true
game.Workspace.workerman.Torso.ActivateDialogue.Enabled = true
script.Parent.ClosingAlt.Position = UDim2.new(-4,-4,-4,-4)
end)
end)
end)
here is server side:
game.ReplicatedStorage.WorkerEvent.OnServerEvent:Connect(function(player, value1)
if value1 == "Option1" then
local clone = game.ReplicatedStorage["ham sandwich"]:Clone()
clone.Parent = player.Backpack
print("given")
elseif value1 == "Option2" then
local clone = game.ReplicatedStorage["turkey sandwich"]:Clone()
clone.Parent = player.Backpack
print("given")
elseif value1 == "Option3" then
local clone = game.ReplicatedStorage["grilled cheese"]:Clone()
clone.Parent = player.Backpack
print("given")
end
end)