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

How to make a Modulescript delete a localscript aka "CutsceneScript" from all players' playerguis?

Asked by 3 years ago

Hi, I'm wondering how I edit this modulescript to make it delete a Localscript named CutsceneScript from all players' playerguis. I'm using the script I used to insert it as a base. I already tried mightwork:Destroy, but that didn't work, and I'm not sure what I'm doing wrong.

local module = {}
local mightwork = script.CutsceneScript
function module.awawa()
for _, player in pairs(game.Players:GetPlayers()) do
    local playerGui = player.PlayerGui
    if playerGui and playerGui:FindFirstChild('mightwork') == nil then
        local mightClone = mightwork:Clone()
        mightClone.Parent = playerGui
        end
    end
end

return module

0
where are you calling the functino User#30567 0 — 3y
0
I believe you can't access the gui in PlayerGui from the server unless it is explicitly cloned in from the server. You'd want to use a RemoteEvent, firing to every client and deleting it with a path. I'd assume this isn't a localscript either as you cannot access the PlayerGui from another client at all. InedibleGames 150 — 3y
0
i'm calling it via a command in studio as require(game.Workspace.ModuleScript).awawa() sylveon_simp 5 — 3y

Answer this question