Hello developers,
I know this sounds stupid, but I’m having issues firing a remote event on the client and then it not working. (no errors provided)
Here is my script from the server: (also yes I’m currently using a dialogue system, don’t ask please)
local gate = game.Workspace.Castle.Folder.Gate
local gateL = gate["Left door"]
local gateR = gate["Right door"]
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local enableScreenGuiEvent = ReplicatedStorage:WaitForChild("Fade", 5)
local Action = {};
local function freezeAllPlayers()
for _, player in Players:GetPlayers() do
if player.Character and player.Character:FindFirstChild("Humanoid") then
local humanoid = player.Character.Humanoid
humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
end
end
end
Action.Synchronous = false; -- Stops the player from proceeding to the next dialogue/leaving
-- the conversation until the action is complete.
-- Note: If this is an "action before" function,
-- this causes the dialogue box to be *blank*
-- until the action is complete.
Action.Variables = function(player)
-- This function is ran prior to the Execute function.
-- It's meant for setting conversation variables.
-- It's helpful if you want this to be an asynchronous action,
-- yet need to set variables for the dialogue that'll appear next.
return {}; -- These variables will overwrite any conversation variables you describe.
-- You can call these variables in your dialogue by using
-- [/variable=REPLACE_WITH_VARIABLE_NAME]
end
Action.Execute = function(player)
game.Workspace.Gatekeeper.Torso.ProximityPrompt.Enabled = false
freezeAllPlayers()
wait(1)
local gateLPivot = gateL:GetPivot()
local gateRPivot = gateR:GetPivot()
-- Open the gate
game.SoundService.GateOpen:Play()
for i=1, 90, 1 do
gateL:PivotTo(gateLPivot * CFrame.Angles(0, math.rad(-i), 0))
gateR:PivotTo(gateRPivot * CFrame.Angles(0, math.rad(i), 0))
wait(0.013)
end
enableScreenGuiEvent:FireAllClients()
wait(1)
game.SoundService.GateClose:Play()
for i=89, 0, -1 do
gateL:PivotTo(gateLPivot * CFrame.Angles(0, math.rad(-i), 0))
gateR:PivotTo(gateRPivot * CFrame.Angles(0, math.rad(i), 0))
wait(0.013)
end
end;
return Action;
Here is my script from the client:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local enableScreenGuiEvent = ReplicatedStorage:WaitForChild("Fade", 5)
local player = game.Players.LocalPlayer
local screenGui = player:WaitForChild("PlayerGui", 5):WaitForChild("Fade", 5)
local TweenService = game:GetService("TweenService")
local function enableScreenGui()
local screenGui = game.StarterGui:FindFirstChild("Fade")
if screenGui then
screenGui.Enabled = true
local frame = screenGui.Frame
local good = frame.Good
local luck = frame.Luck
frame.Visible = true
end
end
enableScreenGuiEvent.OnClientEvent:Connect(enableScreenGui)
This might be a waste of time, sorry, but I really need the help! Also, the script is to enable a screen gui on the client. (for everyone)