I'm trying to make a revolver that upon pressing 'e', a brick appears. I've been looking for a while, and I came across multiple people saying that in order to find the Torso of a character, it needs to be a local script. How can I make bricks spawn in front of the player without being client sided?
Basically, this is what I have so far. (The Local script.)
local tool = script.Parent
local UserInputService = game:GetService("UserInputService")
local connection
local player = game.Players.LocalPlayer
local function Connect()
connection = UserInputService.InputBegan:Connect(function(input, gp)
if gp then return end
if input.KeyCode == Enum.KeyCode.E then
script.RemoteEvent:FireServer()
end
end)
end
local function Disconnect()
connection:Disconnect()
end
tool.Equipped:Connect(Connect)
tool.Unequipped:Connect(Disconnect)
(The Regular script.)
local player = game.Players.LocalPlayer
local wepen = script.Parent.Parent.Parent
script.Parent.OnServerEvent:Connect(function(Player)
local brick = Instance.new("Part",workspace)
brick.Parent = workspace
brick.CFrame = wepen.CFrame*CFrame.new(0,0,-5)
wait(3)
brick.Transparency = 0.1
wait(0.05)
brick.Transparency = 0.2
wait(0.05)
brick.Transparency = 0.3
wait(0.05)
brick.Transparency = 0.4
wait(0.05)
brick.Transparency = 0.5
wait(0.05)
brick.Transparency = 0.6
wait(0.05)
brick.Transparency = 0.7
wait(0.05)
brick.Transparency = 0.8
wait(0.05)
brick.Transparency = 0.9
wait(0.05)
brick.Transparency = 1
wait(1)
brick:Destroy()
end)
Anytime I at least try to find the Torso, I always get an error.

1 comment
On Line 1 of your "Regular Script", which I am assuming is a Script, is trying to find the LocalPlayer, which is what only LocalScripts can do.