I checked, it’s the right remote event, I even looked up how to create a function for this, and this is exactly how they do it, but it doesn’t work for me
Is it printing the “m” in the local script?
It prints “m” in the LOCAL script. But its not printing the arrow value in the server script.
Can you please try adding a print between each one of these if statments
if input.KeyCode == Enum.KeyCode.Up then
Remote:FireServer(1)
Maybe it isn’t actually firing, and I do recommend you always put a lot of prints between if statements when debugging, it’s really helpful
Ok now i see the problem, its not going past the if statement (oof) how do i fix it?
ok now its firing, but now it says that arrow is not a valid member of player(problem from server script)
Event.OnServerEvent:Connect(function(player, arrow)
script.Parent.Arrow.Value = arrow
print(arrow)
end)
my current local script:
local UIS = game:GetService("UserInputService")
local Remote = game.ReplicatedStorage:WaitForChild("ArrowBind")
local player = game.Players.LocalPlayer
UIS.InputBegan:Connect(function(input, processed)
if input.UserInputType.Name == "Keyboard" and processed == false then
if input.KeyCode == Enum.KeyCode.Up then
print("1")
local Arrow = 1
Remote:FireServer(Arrow)
elseif input.KeyCode == Enum.KeyCode.Right then
print("2")
local Arrow = 2
Remote:FireServer(Arrow)
elseif input.KeyCode == Enum.KeyCode.Down then
print("3")
local Arrow = 3
Remote:FireServer(Arrow)
elseif input.KeyCodee == Enum.KeyCode.Left then
print("4")
local Arrow = 4
Remote:FireServer(Arrow)
end
end
end)
Did you make the value object parented to the player?
Edit: Instead of what I presume you’ve done (parenting the server script to the player), put it in ServerScriptService, then from your code use player.Arrow.Value = arrow
instead of script.Parent
.
script.Parent.Arrow
maybe doesn’t exist yet, or didn’t load yet? Also since it said arrow is not a valid member of player
that means that script.Parent
is the player, and this script is parented to the player how is that? Because this is a server script