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