local player = game.Players.LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")
script.Parent.MouseButton1Click:Connect(function()
ReplicatedStorage:FindFirstChild("EquipSword"):FireServer(script.Parent.Name)--line5
end)
I have a similar script that i used to fire a remote event
local RemoteEvent = game.ReplicatedStorage:WaitForChild("SyrupEvent")
local prox = script.Parent
prox.Triggered:Connect(function(player)
RemoteEvent:FireClient(player)
end)
this is a regular script, and it was used for a ProximityPrompt so i placed it right under, i see you are trying to make it work with im guessing a gui button right?
local player = game.Players.LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage:WaitForChild("EquipSword")
script.Parent.MouseButton1Click:Connect(function()
Event:FireServer(script.Parent.Name)
end)