I want it so that, whenever I click on a player with my tool it will teleport them to a different block.
The issue is that I was able to figure out how to gett he players name of whoever I clicked on, but I do not know where to go from their, I searched up tutorials and what not but I just can’t seem to understand.
I have tried Tutorials on module scripts and remote events, I have searched up people with similar problems on the dev forum.
Local Script inside of the tool
-- local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AnubisEvents = ReplicatedStorage:WaitForChild("AnubisEvents")
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouse.Button1Down:Connect(function()
if mouse.Target.Parent:FindFirstChild("HumanoidRootPart") then
AnubisEvents.BanishEvent:FireServer(mouse.Target.Parent.Name)
end
end)
Server script inside of the tool
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local AnubisEvents = ReplicatedStorage:WaitForChild("AnubisEvents")
AnubisEvents.BanishEvent.OnServerEvent:Connect(function()
end)