My remote event does not work for some reason. I get no errors.
When I click the button it does not do what I programmed it to do. Here is the code.
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(plr) local Frame = game.StarterGui.JumpCounter.Frame Frame.Trail1.MouseButton1Click:Connect(function() Frame.Visible = true if game.Players.LocalPlayer.leaderstats.Jumps.Value >= 50 then script.Parent.Parent.Frame.Trail1.Visible = true else script.Parent.Parent.Frame.Trail1.Visible = false if game.Players.LocalPlayer.leaderstats.Jumps.Value >= 100 then script.Parent.Parent.Frame.Trail1.Visible = true script.Parent.Parent.Frame.Trail2.Visible = true else script.Parent.Parent.Frame.Trail1.Visible = false script.Parent.Parent.Frame.Trail2.Visible = false end end end) end)
Code in the button:
script.Parent.MouseButton1Click:Connect(function(plr) game.ReplicatedStorage.RemoteEvent:FireServer(plr) end)
The Server Script looks fine although one thing i noticed about it you need to access the gui through plr.PlayerGui instead of game.StarterGui
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(plr) local Frame = plr.PlayerGui.JumpCounter.Frame Frame.Trail1.MouseButton1Click:Connect(function() Frame.Visible = true if game.Players.LocalPlayer.leaderstats.Jumps.Value >= 50 then script.Parent.Parent.Frame.Trail1.Visible = true else script.Parent.Parent.Frame.Trail1.Visible = false if game.Players.LocalPlayer.leaderstats.Jumps.Value >= 100 then script.Parent.Parent.Frame.Trail1.Visible = true script.Parent.Parent.Frame.Trail2.Visible = true else script.Parent.Parent.Frame.Trail1.Visible = false script.Parent.Parent.Frame.Trail2.Visible = false end end end) end)
on the local script you don't need to pass plr through the args so it should be like this
script.Parent.MouseButton1Click:Connect(function() game.ReplicatedStorage.RemoteEvent:FireServer() end)