Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

why wont this remote event first to the server?

--- local script----
script.Parent.MouseButton1Click:connect(function()
	game.ReplicatedStorage.RemoteEvent:FireServer(script.Parent.CName, script.Parent.CValue)
end)
--Server--
game.ReplicatedStorage.RemoveEvent.OnServerEvent:connect(function(player, CName, CValue)
	game.Workspace.CNameW = CName.Value
	game.Workspace.CValueW = CValue.Value
end)

ERROR: attempt to index local 'CName' (a nil value)

2 comments

0

You could try sending the values in the local script

0

but exploiters will be able to change that i dont want that.

1 answer

If CName is an object, you cannot send it through a RemoteEvent since it is an Instance as stated a the bottom of this page. If you do send it, it comes back nil. You would have to send the Name of the object or other property value such as..

Booleans, Numbers, Tables, Vectors, CFrames, ect...

Looking at your code, you likely want... script.Parent.CName.Name and script.Parent.CValue.Value

This discussion is preserved as it was. New answers, comments, and votes are closed.