Nothing is being passed when i Invoke the server using a remotefunction from the local client. Only output is “Pressed” but expected output is supposed to be “pressed” and “Invoked” and “invalid”. No errors in output at all. Any help will be appreciated thanks in advanced.
local script:
GameFrame.Box1.MouseButton1Click:Connect(function()
print("pressed")
local ans = Hit:InvokeServer(script.Parent.Box1)
print(ans)
end)
Server script:
Hit.OnServerInvoke:Connect(function(plr,BoxNumber)
print("Invoked")
local Reply = "Invalid"
if plr.Name == script.Parent.Turn.Value and script.Parent:FindFirstChild(BoxNumber).Value == "" then
if plr.Name == Player1.Value then
script.Parent:FindFirstChild(BoxNumber).Value = "O"
elseif plr.Name == Player2.Value then
script.Parent:FindFirstChild(BoxNumber).Value = "X"
end
Reply = CheckForWin()
if CheckForWin() == "NA" then
print("Havent finish")
if script.Parent.Turn.Value == Player1.Value then
script.Parent.Turn.Value = Player2.Value
else script.Parent.Turn.Value = Player1.Value
end
elseif Reply == "O" then
script.Parent.P1Score.Value += 1
print("p1 won")
elseif Reply == "X" then
script.Parent.P2Score.Value += 1
print("p2 won")
end
end
return Reply
end)