So I am looking at a script and they did something that confused me. I am going to show you an example of what they did and I was just wondering if you can help me understand this.
What they basically did
script 1(local script that is firing an event)
local tool = script.Parent
local player = game:GetService("Players").LocalPlayer
local playerCharacter = player.Character
local Event = tool:WaitForChild("OnShoot")
local playerMouse = player:GetMouse()
script.Parent.Activated:Connect(function(mouse)
Event:FireServer(mouse.Hit)
end)
script 2(a script that is going to see when the remote event is fired)
local tool = script.Parent
local Event = tool:WaitForChild("OnShoot")
Event.OnServerEvent:Connect(function(player, Mousehit)
end)
So when the local script fired the event and it looks like they made a mouse parameter and said “mouse.Hit” or pretty much sending to the server script what the mouse clicked on. And then it looks like the server script picked up the mouse hit and then it also said “player” player with it. or like this (player, Mousehit) and I was wondering how they can do that and why?