How do I transfer info from local to normal script

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?

1 Like

Sorry, after some more videos i have learnt you need to use :WaitForChild(“FireHolding”)

1 Like

Just make sure you are using the output to scout your errors. And also this title to me feels a lot different then the problem you stated in the description.

1 Like

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