Remote ID's not getting compared correctly

So, I’m trying to make a remote ID that randomizes whenever a tool is clicked and another value is set to the ID then the ID gets transferred to the remote event which then checks if the ID is the same as the other ID value. I’m not good at this kind of stuff so this could be completely useless.

Module Script

local module = {}

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ServerStorage = game:GetService("ServerStorage")

function module.Develop()

local HttpService = game:GetService("HttpService")

local ID = HttpService:GenerateGUID(false)

script.Parent.DevelopID.Value = ID

ReplicatedStorage.Remotes.Develop:FireServer(ID)

end

return module

Normal Script

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local debounce = false

ReplicatedStorage.Remotes.Develop.OnServerEvent:Connect(function(plr,ID)
	if not debounce then
		debounce = true
		local char = plr.Character
		print(ID)
		if ID == char.Dev.DevelopID.Value then
			print("ID is correct")
		else
			print("ID is not correct")
		end
		debounce = false
	end
end)

It keeps returning ID is not correct.

2 Likes

is Dev a value object? if so try if ID == char.Dev.Value

I forgot to type one part. I meant if ID == char.Dev.DevelopID.Value then also it still returns false.

i’ll need more information. what script is calling the module? if it’s a local script that’s the problem. anything set locally won’t be seen serverside. aside from this you can generate a GUID server side and implent it into the user’s character on CharacterAdded.

example if a number value in workspace is stated as 10 it remains 10 when changing it locally:

-- local
workspace.Number.Value = 5
Remote:FireServer()
-- server
Remote.OnServerEvent:Wait()
print(workspace.Number.Value)
-- output: 10

It’s a local script. So, I can’t set anything locally and see it on the server-side? If I’m reading that correctly.

that’s correct yes. you’ll need to set it server side in order to let the server read the changes.

everything you see is replicated from server to client. nothing can be replicated from client to server without some major security issues regarding exploiters abusing your remoteEvents/remoteFunctions so that’s not recommended.

1 Like