This part of my local script here, (tool is defined as script.Parent), sends a signal to a remote function,
script.Parent.Equipped:Connect(function() game.ReplicatedStorage.equipstatus:FireServer(tool) script.Parent.equip.Value = 1 idleanim.Priority = Enum.AnimationPriority.Action2 idleanim.Looped = true idleanim:Play() script.Parent.scytheblade.CanCollide = false script.Parent.Handle.CanCollide = false script.Parent.scytheblade.Anchored = false script.Parent.Handle.Anchored = false end)
This is the script associated with the remote event,
game.ReplicatedStorage.equipstatus.OnServerEvent:Connect(function(tool) tool.equip.Value = 1 end)
It errors, saying, "equip is not a valid member of Player "Players.Stiles8353" " yet my definition for tool is the local scripts parent, so how is this possible?
Well, I don't see where you define what "tool" is
so you'd just add a variable for it
Edit: Nevermind, I see the problem now, try doing this:
· Create a variable for the player and just send it through the RemoteEvent
LocalScript:
script.Parent.Equipped:Connect(function() local plr = tool.Parent game.ReplicatedStorage.equipstatus:FireServer(plr) script.Parent.equip.Value = 1 idleanim.Priority = Enum.AnimationPriority.Action2 idleanim.Looped = true idleanim:Play() script.Parent.scytheblade.CanCollide = false script.Parent.Handle.CanCollide = false script.Parent.scytheblade.Anchored = false script.Parent.Handle.Anchored = false end)
· Then we just get the tool through the player we sent
Edit 2: You just had to enter your tool's name in the script, because since I can't see how you made the tool, I don't know it's name, now, just change the toolName
variable to the exact tool's name in the script below
Script:
game.ReplicatedStorage.equipstatus.OnServerEvent:Connect(function(plr) local toolName = "Enter the tool name here" local tool = plr.Character[toolName] tool.equip.Value = 1 end)
Since the equipstatus
event is fired when equipped, the tool will be in the character, but if it was necessary we could just check for both places, the character and the player's backpack.