#wont send a message to the output or make the text visible

1 messages · Page 1 of 1 (latest)

worldly reef
#

i want to make it so that when a player presses E a text pops up for the player but it wont send a message to the output or make the text visible, any help?

script that sends event

uis.InputBegan:Connect(function(input, gpe)
    if gpe then return end
    if allowed == true and input.KeyCode == Enum.KeyCode.E then
        print("e pressed")
    else if allowed == false and input.KeyCode == Enum.KeyCode.E then
            game.ReplicatedStorage.notAllowed:FireServer()
            print("not allowed")
        end
    end
end)

script that receives the event

local gui = script.Parent.Parent
local text = script.Parent


game.ReplicatedStorage.notAllowed.OnClientEvent:Connect(function(plr)
    print("not worthy")
    text.Visible = true
    task.wait(2)
    text.Visible = false
end)

both are local scripts and the first script is in startercharacter while the other is in starter gui

nimble ether
#

If the second scenario is the case, then you should use a bindable event

worldly reef
#

so remote events only work when its from a local script to a serverscript?

worldly reef
#

also would u use "fire()" to fire a bindable event?

nimble ether
#

This is why you’re either calling “FireServer” on clients or “FireClient” on server

worldly reef
#

and what to call it

#

or to receive i mean

nimble ether
#

Event or something

#

Let me double check

worldly reef
#

aight

nimble ether
#

Event yeah

worldly reef
#

alr thanks for the help

#

thats good to know

worldly reef
#

thats my last question

nimble ether
worldly reef
#

okay thanks