So for some reason, the code is suppose to go back and forth between the server,which it does, however it does it in the wrong order. I have checked the code using print to debug and it goes Test, Tested, Testing, instead of Testing, Tested, Test.
That is the only problem with the script. Help.
local script:
local Yes
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteFunction = ReplicatedStorage:WaitForChild("RemoteFunction")
local Object = ReplicatedStorage:WaitForChild("Flowers")
Playerer = game.Players.LocalPlayer
Mouse = Playerer:GetMouse()
Mouse.Button1Down:Connect(function()
RemoteFunction:InvokeServer(Object)
print("Testing")
end)
RemoteFunction.OnClientInvoke = function(player)
local Flowers = game.Workspace:FindFirstChild("Flowers")
Yes = Playerer.Character:FindFirstChild("Torso") or Playerer.Character:FindFirstChild("UpperTorso")
Flowers.Parent = workspace
Flowers:SetPrimaryPartCFrame(CFrame.new(Yes.Position + (Yes.CFrame.lookVector * 2.5)))
print("Test")
end
script:
local Flowers = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteFunction = ReplicatedStorage:WaitForChild("RemoteFunction")
Object = game:GetService("ReplicatedStorage"):WaitForChild("Flowers")
RemoteFunction.OnServerInvoke = function(player, Object)
Flowers = Object:Clone()
Flowers.Parent = workspace
RemoteFunction:InvokeClient(player)
print("Tested")
end

1 comment
When I read this, I did not understand, now I do. I am really new to servers and clients working together. I solved the problem on my own. Thank you for your solution, take a upvote :D