Thank you so much for your reply. I did some research about bindable events and i did something like this with your suggestion. I have seat object on workspace for testing and there is click detector child of seat. Lastly a script object child of click detector. Oh and of course bindable event on replicated storage called "DeskClicked". Here is a code of this script :
local clicked = game:GetService("ReplicatedStorage"):WaitForChild("DeskClicked")
local clickDetector = script.Parent
local seatPosition = script.Parent.Parent:FindFirstChild("Seat").Position
clickDetector.MouseClick:Connect(function(player)
print("Event Fired!")
clicked:Fire(player,seatPosition)
end)
and there is a listener script object on ServerStorage called HandleDeskClick here is the code :
local Clicked = game:GetService("ReplicatedStorage"):WaitForChild("DeskClicked")
Clicked.Event:Connect(function(plr, seatPosition)
local char = workspace:FindFirstChild(plr)
char:MoveTo(seatPosition)
print("Event Handled!")
end)
I can see Event Fired! message on console but there is no Event Handled! message. And there is no error output too. Is there any mistake i made ? Thanks!
1 comment
I couldn't reply your message with detailed explanation so i send it as a answer. Can you check my code please :(