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

I'm unable to get a BindableFunction to work in displaying a GUI... any help?

Asked by 6 years ago
Edited 6 years ago

This is my first time experimenting with Bindable/Remote events/functions, and after some researching I wanted to see how I could apply them to a notifier GUI I created a while back.

Basically, the GUI is copied and inserted into the player's PlayerGui (making it visible) when they click a button. The problem, though, is that nothing happens when I click the button.

Here's the script inside the button:

function FireNotify(player)
    game.ReplicatedStorage.Actions.Notify:Fire()
end

script.Parent.ClickDetector.MouseClick:connect(FireNotify)

And the script that applies a function to the BindableEvent:

local Player = game.Workspace.LocalPlayer

function Create()
    if Player.PlayerGui:FindFirstChild("Note") ~= nil then
        game.StarterGui.LocalSounds.Warn:Play()
    elseif Player.PlayerGui:FindFirstChild("Note") == nil then
        local newNote = game.ReplicatedStorage.Notes.Note:Clone()
        newNote.Parent = Player.PlayerGui
        game.StarterGui.LocalSounds.Warn:Play()     
    end
end


game.ReplicatedStorage.Actions.Notify:connect(Create)

I checked the addresses of all of the objects mentioned within the two scripts and they seem to be fine. I feel like there's something I'm doing horribly wrong; as this this my first time working with BindableEvents.

Any advice?

0
Changing objects in StarterGui when the game is loaded does not effect PlayerGui GingeyLol 338 — 6y
0
In other words, you need to get the players and PlayerGui GingeyLol 338 — 6y
0
The script inside the button is a server script and the other one is a LocalScript, right? If so, I'm not sure what's going on, but would recommend adding 'print' statements to the first line of each function to see if they're running or not. If those aren't server script and LocalScript respectively, you'll need to change it (and maybe read the guides available at the top of this site on Server-C chess123mate 5873 — 6y

Answer this question