I have two script. One for firing the remote event and one for receiving. I have a remote event in ReplicatedStorage. I also have a script in ReplicatedStorage. The remote vent is not being fired for some reason. Please help. TIA for any help. BTW I can't click on the code button because if I move my mouse, StackEdits will close out
Script in Replicated... local ReplicatedStorage = game:GetService('ReplicatedStorage')
remote = game.ReplicatedStorage.QueEvent
remote.OnServerEvent:Connect(function(plr, num)
print(plr.Name)
print(num)
if num == 0 then
script.Parent.Que.Value = 0
else
script.Parent.Que.Value = script.Parent.Que.Value + num
end
end)
LocalScript inside a button in a players Gui local ReplicatedStorage = game:GetService('ReplicatedStorage')
remote = game.ReplicatedStorage.QueEvent
script.parent.MouseButton1Click:Connect(function()
if game.Players.LocalPlayer.Playing.Value == false then
game.Players.LocalPlayer.Playing.Value = true
script.Parent.Text = 'UnReadyUp'
script.Parent.Parent.QueLabel.TextTransparency = 0
script.Parent.Parent.QueLabel.BackgroundTransparency = 0
remote:FireServer(1)
print('+1')
else
game.Players.LocalPlayer.Playing.Value = false
script.Parent.Text = 'ReadyUp'
script.Parent.Parent.QueLabel.TextTransparency = 1
script.Parent.Parent.QueLabel.BackgroundTransparency = 1
remote:FireServer(-1)
print('-1')
end
end)
One thing I see is that the path to your RemoteEvent isn't correct. You have:
local ReplicatedStorage = game:GetService(‘ReplicatedStorage’) remote = game.ReplicatedStorage.QueEvent
Which ends up making remote equal to game.game.ReplicatedStorage.QueEvent
Instead leave out the game. in the remote assignment and make it just local remote = ReplicatedStorage.QueEvent
Also, the variable for your replicated storage might get confused. I'd try to play it safe by naming it something else like repStorage.
local repStorage = game:GetService('ReplicatedStorage') local remote = repStorage.QueEvent