You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? I’m doing this code to a friend, but for some reason the code stopped working, the server simply refuses to read the passed value as true, dispiting the code being correct
-
What is the issue? Include screenshots / videos if possible!
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
--Client:
local PL = game:GetService("Players")
local RP = game:GetService("ReplicatedStorage")
local UIS = game:GetService("UserInputService")
local Player = PL.LocalPlayer
local Wizard = RP:WaitForChild("Wizard")
local Equip = Wizard:WaitForChild("Equip")
local Debounces = {
WandEquipped = false,
}
UIS.InputBegan:Connect(function(input,gameprocessedevent)
if not gameprocessedevent then
if UIS.KeyboardEnabled then
if input.KeyCode == Enum.KeyCode.Q then
print("Pressed Q")
elseif input.KeyCode == Enum.KeyCode.E then
if Debounces.WandEquipped == false then
Debounces.WandEquipped = true
Equip:FireServer(Debounces.WandEquipped)
elseif Debounces.WandEquipped == true then
Debounces.WandEquipped = false
Equip:FireServer(Debounces.WandEquipped)
end
elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
print("Mouse 1 Button Down")
end
end
end
end)
--Server
Equip.OnServerEvent:Connect(function(Player,WandEquipped)
if WandEquipped == true then -- script doesn't gets past this
--Do stuff
print("Equipped")
else
print("Unequipped")
end
print(WandEquipped)
end)