Hey, hi, hello
Before I start, I know that there was post earlier today that had the same name, so sorry if that’s a bit annoying. I did look at that post and it’s not helping me with this issue.
So I have a sword where a localscript is creating this error
21:34:05.673 - Players.Gashphul.Backpack.LinkedSword.Localscript:28: attempt to index nil with 'connect'
These are the bits making the error:
local tool = script.Parent
local replicatedstorage = game:GetService("ReplicatedStorage")
local modules = replicatedstorage:WaitForChild("Modules")
local killnotification = require(modules:WaitForChild("KillNotification"))
local events = tool:WaitForChild("Events")
local killnotification = events:WaitForChild("KillNotification")
tool.Equipped:connect(function()
killnotification.OnClientEvent:connect(function(targetname)
killnotification:CreateNotification(targetname,"Slashed",Color3.new(85, 170, 255),tool.Parent)
end)
end)
There’s another OnClientEvent function for a different remoteevent and that works fine. Can anyone help me?