So basically, i have a set of parts called "Save_Player" and what I want is, for the player to click it and hope that it gets the player out of a jail, although in the process, I need to understand how, to send mouse data over to the server and make sure that it doesn't get the wrong player out of the wrong jail. What I was thinking was using arrays but, I am not sure how arrays would be effected if new parts appear within a map, here is an example:
--localscript
local m = game.Players.LocalPlayer:GetMouse()
while true do wait()
if m.Target then
if m.Target.Name == "Save_Player" then
game.ReplicatedStorage.Remote:FireServer(m.Target)
end
end
end
--server
game.ReplicatedStorage.Remote.OnServerEvent:Connect(function(p,d)
if d then
print('saving player')
end
end)
if you know how to fix this, give me an idea or some code please, thanks.

1 comment
loser