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

i need help on how to make a proximity prompt load multiple guis by chance anyone can help?

Asked by 2 years ago

need help on a script im not really good at scripting so thats why im asking

0
and i need music to play TheModdedFox 0 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

If you would like to make it so when a brick is touched a gui appears, i reccommend reading this forum post from another user. You can then just make the brick transparent and CanCollide ticked off.

https://scriptinghelpers.org/questions/77801/how-do-i-make-a-gui-appear-when-the-player-is-touching-a-part-by-a-script

With the implementing the music part, its simple, im going to use the script I previously linked, but just implementing the music. You are going to want to add you music into the lighting tab.

    local Workspace = game.Workspace

    local Tpart = Workspace:WaitForChild("Part23") -- Defines a way to a part. Change Part23 to name of the Part.

    local Players = game:GetService("Players")

    local Music = game.Lighting.Test1 -- Make Test1 the name of your music.

    -- Code starts here

    local deb = 0

    -- Makes the frame visible

    Tpart.Touched:Connect(function(hit)

    if deb == 0 then

    deb = 1

    local char = hit.Parent

    if char then

    local hum = char:WaitForChild("Humanoid")

    if hum ~= nil then

    print("Opening the Gui")

    local Player = Players:GetPlayerFromCharacter(char)

    local PlayerGui = Player.PlayerGui

    local GuiToBeOpened = PlayerGui:WaitForChild("Test1") -- Change Test1 to name of the Screengui.

    Music:Play()
    GuiToBeOpened.Frame.Visible = true

    end

    end

    end

    end)

-- ?? Disappears the frame

    Tpart.TouchEnded:Connect(function(hit)

    if deb == 1 then

    deb = 0

    local char = hit.Parent

    if char then

    local hum = char:WaitForChild("Humanoid")

    if hum ~= nil then

    print("Opening the Gui")

    local Player = Players:GetPlayerFromCharacter(char)

    local PlayerGui = Player.PlayerGui

    local GuiToBeOpened = PlayerGui:WaitForChild("Test1") -- Change Test1 to name of the Screengui.

    Music:Stop()
    GuiToBeOpened.Frame.Visible = false

    end

    end

    end

    end)

Ad

Answer this question