Getting replicated data not working

This is the script:

local plr = game.Players.LocalPlayer
local Controller = require(game.ReplicatedStorage:WaitForChild("GetData"):WaitForChild("ReplicaController"))
local Event = game.ReplicatedStorage:WaitForChild("Events"):WaitForChild("Output")
local Info = require(game:GetService("ReplicatedStorage"):WaitForChild("Modules"):WaitForChild("SealInformation"))

local UIS = game:GetService("UserInputService")
Controller.RequestData()

local function INPUT(key)
	Controller.ReplicaOfClassCreated("PlrReplica//"..plr.UserId,function(replica)
		print(replica.Data.Seal)
		local GetMove = Info[replica.Data.Seal]
		if GetMove and GetMove["KEYBINDS"][key] then
			Event:FireServer("Outputs","UseMove",plr,GetMove["KEYBINDS"][key])
		end
	end)	
end

local function INPUTENDED(key)
	
end

UIS.InputBegan:Connect(function(input,isTyping)
	local KEY
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		KEY = "M1"
	elseif input.UserInputType == Enum.UserInputType.MouseButton2 then
		KEY = "M2"
	else
		KEY = input.KeyCode.Name
	end
	task.spawn(INPUT,KEY)
end)

UIS.InputEnded:Connect(function(input)
	local KEY
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		KEY = "M1"
	elseif input.UserInputType == Enum.UserInputType.MouseButton2 then
		KEY = "M2"
	else
		KEY = input.KeyCode.Name
	end
	task.spawn(INPUTENDED,KEY)
end)

nothing prints out in the input function

1 Like

The issue is not this script, but your ModuleScript’s “ReplicaOfClassCreated.”
I’ve tried following your code and testing it out myself and it works fine. Though, I tried passing a simple function as a parameter in a module script, and it did not fire the function (I’m not too experienced with this kind’ve stuff but maybe something to look into?).

i didnt make the module script it was a open-source module, try looking into it “ReplicateService”

i might be mistaken on your response

Sorry to bump into this topic so late, but I recently ran into the same issue and solved it. I tried using the replicated data function inside of a local function in a big script and it didn’t seem to run. A simple solution for me was to wrap all the other fuctions inside of the replicated data function.