I’m trying to return the BoolValue to the server script, but they return as nil no matter what
Firing the client even from the script:
mainsword.Handle.Touched:Connect(function(hit)
if hit and hit:FindFirstAncestorOfClass("Model") then
local brg = game.ReplicatedStorage.Get_brg_value:FireClient(player)
print(brg)
end
end)
Also I’d like to add that this isn’t because the value of Barraging is nil or the BoolValue itself doesn’t exist. Even when I just return “true” or “false” it returns as nil.
Use a RemoteFunction for this, you cannot return anything with RemoteEvents. For example (with Get_brg_value as a RemoteFunction):
mainsword.Handle.Touched:Connect(function(hit)
if hit and hit:FindFirstAncestorOfClass("Model") then
local brg = game.ReplicatedStorage.Get_brg_value:InvokeClient(player)
print(brg)
end
end)
game.ReplicatedStorage.Get_brg_value.OnClientInvoke = function()
return barraging.Value
end