Script in gui opening other players' guis?
I have this local script that when an Image Button is clicked, it opens a gui called "Frame". The frame is used for editing inventory stuff, which raises an immediate problem, trolling. I have no idea why the gui is opening another gui rather than itself.
The bug only happens when multiple people are in the server, and to the second player to open the inventory. If that player tries to use the gui, the script spits out a wad of errors and doesn't do anything. Any help?
This is what I think the bugged part of the script is
01 | script.Parent.MouseButton 1 Click:Connect( function (clk) |
03 | local Plr = game.Players.LocalPlayer |
04 | local Box 1 = workspace.InvetoryBoxes.Invetory 1 |
05 | local Box 2 = workspace.InvetoryBoxes.Invetory 2 |
06 | local Box 3 = workspace.InvetoryBoxes.Invetory 3 |
07 | local Box 4 = workspace.InvetoryBoxes.Invetory 4 |
08 | local Box 5 = workspace.InvetoryBoxes.Invetory 5 |
09 | workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable |
12 | if workspace.InvetoryBoxes.Invetory 1. InvetoryBox 1. Occupied.Value = = false then |
14 | workspace.CurrentCamera.CFrame = CFrame.new(Box 1. Camera 1. Position) |
15 | print ( "Camera is Ready!" ) |
17 | local remote = game.ReplicatedStorage:WaitForChild( "Occupy1" ) |
18 | local valueToChange = workspace.InvetoryBoxes.Invetory 1. InvetoryBox 1. Occupied |
19 | remote:FireServer(valueToChange) |
21 | Plr.PlayerGui.Inventory.Frame.Visible = true |
22 | Plr.PlayerGui.Inventory.ImageButton.Visible = false |
Any help?