FireServer prints things I dont want

Hi guys, I’m making a togglable aura system but when I fire the remote with 3 arguments (player, type of aura, and enabled value). Its printing this: (name, name, none (default type of aura))

Every script and remote is inside a folder inside StarterCharacterScripts

LocalScript:

local uis = game:GetService("UserInputService")
local enabled = false

local db = false
local dbtime = 1

uis.InputBegan:Connect(function(input, istyping)
	if istyping then return end
	if input.KeyCode == Enum.KeyCode.Q then
		if db == false then
			db = true
			if enabled == false then
				local player = game.Players.LocalPlayer
				local auratype = player.leaderstats.Aura.Value
				
				script.Parent.AuraActivate:FireServer(player, auratype, true)
			else
				local player = game.Players.LocalPlayer
				local auratype = player.leaderstats.Aura.Value

				script.Parent.AuraActivate:FireServer(player, auratype, false)
			end
		end
	end
end)

ServerScript:

script.Parent.AuraActivate.OnServerEvent:Connect(function(player, auratype, enabled)
	print(player, auratype, enabled)
end)

What it prints in the Output:

SnakesRobbs746 SnakesRobbs746 None

What I need it to print:

SnakesRobbs746 None (true/false depending on enabled value)

Any help is greatly appreciated

You’re firing the server event incorrectly, you don’t need to put player as an argument.

local uis = game:GetService("UserInputService")
local enabled = false

local db = false
local dbtime = 1

uis.InputBegan:Connect(function(input, istyping)
	if istyping then return end
	if input.KeyCode == Enum.KeyCode.Q then
		if db == false then
			db = true
			if enabled == false then
				local player = game.Players.LocalPlayer
				local auratype = player.leaderstats.Aura.Value
				
				script.Parent.AuraActivate:FireServer(auratype, true)
			else
				local player = game.Players.LocalPlayer
				local auratype = player.leaderstats.Aura.Value

				script.Parent.AuraActivate:FireServer(auratype, false)
			end
		end
	end
end)
1 Like

Thanks so much for the help it works!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.