So whenever i try to use this the error: Attempt to connect failed: Passed value is not a function?
game.ReplicatedStorage.MudaBeatdown.OnServerEvent:Connect(function(player, enemychar)
local char = player.Character
local replicatedstorage = game:GetService("ReplicatedStorage")
local disabledevent = replicatedstorage:WaitForChild("Disabled")
disabledevent.OnServerEvent:Connect(enemychar)
end)
Disabled Script:
game:GetService("ReplicatedStorage").Disabled.OnServerEvent:Connect(function(player, truefalse)
local chr = player.Character
local disabled = chr.Disabled
disabled.Value = truefalse
end)
theres also a Value in the serverstorage called "Disabled"
im trying to make it so it called the event and makes the value Enabled with the disabled script

3 comments
Can you fix your code? You’re missing an ‘End’ at OnServerEvent, and are also connecting an identical signal with itself?? The :Connect() method takes a function callback argument to run upon the event firing, you’re likely giving it something entirely different. What is Enemychar?
enemy char is the enemy's character (like this is a move for example, this isnt all the code the error only bhappens with the disabled)
Do i use anything elsre the connect or whatsovever?