I have an animation game that after I play an animation it adds +1 value to my leaderstats. I used a remote event to fire to the server and add the value there but it does not work.
Local Script:
aughhButton.MouseButton1Click:Connect(function() -- AUGHH Animation -- Variables local humanoid = rig1:WaitForChild("Humanoid") -- Camera camera.CFrame = aughhCameraPart.CFrame camera.FieldOfView = 40 -- Main frame.Visible = false humanoid:LoadAnimation(aughhAnimation):Play() aughhSound:Play() wait(7) frame.Visible = true aughhSound:Stop() humanoid:LoadAnimation(aughhAnimation):Stop() camera.FieldOfView = 70 remoteEvent:FireServer() end)
Script in Server Script Service:
remoteEvent.OnServerEvent:Connect(function(player) player.leaderstats.Plays.Value = player.leaderstats.Plays.Value + 1 end)
and if you can, help me make this more secure. thanks :)