As far as I understand remote function needed in order to send information from script to local script and and make the requested action on the server. Okay, i watched a lot of videos and read a lot of explanations on the forums, but i still didnt understand how to use Remote Function. I have 1 script and 1 local script. I need players who have BoolValue = false to have Speed = 0 at a certain point. I could use RemoteEvent, but it easy to exploit, so thats why i want Remote Function. For example:
--Script speed = 0 game.ReplicatedStorage.Speed:InvokeClient(speed) --Local Script local function teleportdetected(speed) if Value == false then game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = speed end end game.ReplicatedStorage.Speed.OnClientEvent:Connect(teleportdetected)
You got some of it right, but Remote functions don't use :Connect
.
game.ReplicatedStorage.Speed.OnClientInvoke = teleportdetected
Oh, and in case you're confused, you don't need the player parameter unless you use :InvokeServer
and .OnServerInvoke
.