Hello, I am trying to make a object detect when a player has his mouse held down, but I cant transfer the variable from local to normal script. Here is my code:
local rs = game:GetService("ReplicatedStorage")
local re = rs.FireHolding
UIS.InputBegan:Connect(function(io)
if io.UserInputType == Enum.UserInputType.MouseButton1 then
holding = true
re:FireServer(holding)
end
end)
to
local rs = game:GetService("ReplicatedStorage")
local re = rs.FireHolding
re.OnServerEvent:Connect(function(player, holding)
print(holding)
end)
Does anyone know the solution to this?