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

All arguments from RemoteEvent returning as player name?

There's not much to explain here, I don't think. The remoteevent is parented to a gui, but there's no problem with that because it still fires. The Ragdoll BoolValue is changed from client, and the value from client is sent to remoteevent, no problem with that either. But why does it return as player name?

Note: I've also tried sending two arguments, Player and bool, but there's no change with that because they both return as player name.

Localscript:

local c_StandGyro
ValueGui.Ragdoll.Changed:Connect(function()
	ValueGui.RagdollEvent:FireServer(ValueGui.Ragdoll[v])
	if ValueGui.Ragdoll[v] == true then
		c_StandGyro = Root.StandGyro:Clone()
		Root.StandGyro:Destroy()
		Humanoid.Sit = true
	else
		c_StandGyro.Parent = Root
		Humanoid.Sit = false
	end
end)

ValueGui.Ragdoll[v] is a BoolValue as you can see. I've sent it through FireServer(), and it's somehow returning as the players name.

Script:

script.Parent.RagdollEvent.OnServerEvent:Connect(function(val)
	print(val)
	local reverseval
	if val == true then
		reverseval = false
	else
		reverseval = true
	end
	Character.FakeLArm.CanCollide = val
	Character.FakeLLeg.CanCollide = val
	Character.FakeRArm.CanCollide = val
	Character.FakeRLeg.CanCollide = val
	Torso["Left Hip"].Enabled = reverseval
	Torso["Left Shoulder"].Enabled = reverseval
	Torso["Right Hip"].Enabled = reverseval
	Torso["Right Shoulder"].Enabled = reverseval
end)

The character and player has already been defined in the server script, its parented to a gui. Any help is appreciated, thanks.

1 comment

0

This has nothing to do with your question since you've already got an answer. But you can also do: local reverseval = not val

1 answer

✓ Accepted answer

The first parameter supplied in the .OnServerEvent signal is the Client that fired to the Server. This parameter is imposed, so you must define it. All trailing parameters are the valid arguments passed from :FireServer()

Remote.OnServerEvent:Connect(function(Player, val)

1 comment

0

Thanks, not familiar with remoteevents that much.

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