Well, basically I want to send a FireServer and that the player who sent it receives it and not the others. I really don’t know how to make the player that sent the Fire run only with it since all the players have a server script and then when the FireServer is sent, it runs with all of them and I really don’t know how to solve it.
this is the local script that fire sends:
local UserInputService = game:GetService("UserInputService")
local Storage = game:GetService("ReplicatedStorage")
local Datos = Storage:FindFirstChild("DatosDeSistemaDeTala")
local Event = Datos:FindFirstChild("UnequipMaterialEvent")
local Player = game.Players.LocalPlayer
local character = Player.Character
if not character or not character.Parent then
character = Player.CharacterAdded:wait()
end
UserInputService.InputBegan:Connect(function(KeyCode)
local Tronco = character:FindFirstChild("Tronco")
local Rama = character:FindFirstChild("Rama")
local take = character.SistemaDeTala.Taken
if Tronco or Rama then
if (KeyCode.KeyCode == Enum.KeyCode.Q) or (KeyCode.KeyCode == Enum.KeyCode.Backspace) then
Event:FireServer(Player)
end
end
end)
this is the server script that detects the FireServer but I don’t know how to make the player who sent the Fire, only run with the:
local taken = script.Parent:FindFirstChild("Taken")
local player = Players:GetPlayerFromCharacter(char)
local Event = Storage:FindFirstChild("DatosDeSistemaDeTala"):FindFirstChild("UnequipMaterialEvent")
local function PlayerFired(Player)
if Player == player.Name then
taken.Value = false
end
end
Event.OnServerEvent:Connect(PlayerFired)