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

Making a tool spectate GUI. Confused a little. Help?

Asked by 5 years ago
Edited 5 years ago

I asked this question last time but I didn't really explain it that well. So what I am trying to do is a spectate GUI. BUT, it's a tool spectate one. I want to make it so that when a person clicks a GUI then he should be able to spectate a tool whether its in another players backpack or in the Workspace.

local cam = workspace.CurrentCamera
local button = script.Parent

local function get()
    for _,v in pairs(game.Players:GetPlayers()) do
        if v.Backpack:FindFirstChild("Tool") or workspace:FindFirstChild("Tool") then 
            print("Found")
            pcall(function()
                Enum.CameraSubject = v.Backpack.Tool or workspace.Tool
                Enum.CameraType = "Follow"
            end)
        end
    end
end

button.MouseButton1Click:Connect(get)

Well i'm not that good at scripting but at least I tried

willbe_stoped

8788

-- my disc just incase

Answer this question