I have 2 scripts one being local and one being normal script and I'm trying to make it work although it doesn't seem to blow up FE when I make both local scripts.

Local:

local tool = script.Parent
local handle = tool:WaitForChild("Handle")
local Player = game.Players.LocalPlayer
local mouse = Player:GetMouse()
local codwn = false
local at = 1
local qp = false


tool.Equipped:Connect(function()
	qp = true
	if qp ~= false then
		mouse.Button1Down:Connect(function()
			if codwn ~= true then
				codwn = true
				tool:Activate()
				wait(at)
				tool:Deactivate()
				codwn = false
			end
		end)
	end
end)

tool.Deactivated:Connect(function()
	qp = false
end)

Script:

local tool = script.Parent
local handle = tool.Handle
local Player = game.Players.LocalPlayer
local mouse = Player:GetMouse()
local at = 2

tool.Activated:Connect(function()
	--WEAPON EFFECT
	local expo = Instance.new("Explosion", workspace)
	expo.Position = mouse.Hit.Position
	wait(at)
	expo:Destroy()
end)

I am stuck and I don't have any idea why it's not working, it worked when I made the explosion position somewhere else though. (like in handle's position)

3 comments

0

It's not working because ServerScripts do not have a local player and do not have a mouse; the solution? Read through the above comment.

0

Remote events are the way to go in this situation. While yes, the server does not have the mouse, you can include the Mouse in the arguments when firing a remote event.