Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
It happened a long time without using remotefunctions, I attempted to a project during this week and it happens that RemoteFunctions have changed, in order to know more I used the Roblox Education Web, where I got the information that code for them now looks like this:
local Remote = game.ReplicatedStorage.RemoteFunction
Remote.OnServerInvoke = function(plr)
print("test)
end
Alright, the iusse comes when trying to run them with commands, the old code in a normal script was:
local Remote = game.ReplicatedStorage.RemoteFunction
Remote.OnServerInvoke:Connect(function(plr, command)
if command == "test" then
print("test)
else
print("not test")
end
end)
The point is now that, using the new documentation code with commands it’s not working, for example I tried running this short code to test and nothing happens.
local Remote = game.ReplicatedStorage.RemoteFunction
Remote.OnServerInvoke = function(plr, command)
if command == "a" then
print(plr.Name .. "a")
else
print("b")
end
end
Local script code:
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.RemoteFunction:InvokeServer(plr, "a")
end)