Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script in gui opening other players' guis?

Asked by 3 years ago

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

script.Parent.MouseButton1Click:Connect(function(clk)
    print("Clicked")
    local Plr = game.Players.LocalPlayer
    local Box1 = workspace.InvetoryBoxes.Invetory1
    local Box2 = workspace.InvetoryBoxes.Invetory2
    local Box3 = workspace.InvetoryBoxes.Invetory3
    local Box4 = workspace.InvetoryBoxes.Invetory4
    local Box5 = workspace.InvetoryBoxes.Invetory5
    workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
    ----------------Check which boxes are occupied-----------------
    wait(0.01) ---security check---
    if workspace.InvetoryBoxes.Invetory1.InvetoryBox1.Occupied.Value == false then
        print("1 is free!")
        workspace.CurrentCamera.CFrame = CFrame.new(Box1.Camera1.Position)
        print("Camera is Ready!")
        ----------Change Value Non-Locally-----------
        local remote = game.ReplicatedStorage:WaitForChild("Occupy1")
        local valueToChange = workspace.InvetoryBoxes.Invetory1.InvetoryBox1.Occupied
        remote:FireServer(valueToChange)
        print("Fired!")
        Plr.PlayerGui.Inventory.Frame.Visible = true
        Plr.PlayerGui.Inventory.ImageButton.Visible = false

Any help?

1
Can't really do much without more info. I've encounter problems similar to this (items being give to everyone instead of just the local player). If you could put in info as to where your local/normal script are located that'd be great. Also if you could put in the errors it gives you that would be useful as well. DocGooseYT 110 — 3y
0
The local script is located in an imagebutton in a screengui in the startergui. The errors are just parentage issues due to the bug TheB4dComputer 100 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

QUESTION SOLVED ITSELF!!!! I have no idea why it started working, but it did. Bonus points to all those who checked the question out!

Ad

Answer this question