Greetings, DevForum!
I am attempting to create a system that uses client interactions to complete functions on Server. The problem I’ve run into involves RemoteEvents and their workings.
Any event that I fire from the Client will only support one argument. Any other arguments just direct me straight back to the first (Localplayer).
Here’s the code samples of the system:
Client:
uis.InputBegan:Connect(function(input, processed)
if processed ~= true then
if uis:IsKeyDown(Enum.KeyCode.V) then
sv_chant_warcry:FireServer(lp)
end
if uis:IsKeyDown(Enum.KeyCode.B) then
sv_chant_morale:FireServer(lp)
end
if uis:IsKeyDown(Enum.KeyCode.G) then
print("key g pressed")
local pos = inputdevice.Hit.p
sv_fire_ping:FireServer(lp,pos)
print("fired")
end
end
end)
Server:
local function CreatePing(plr,pos)
print("createping")
local nm = plr.Name
local Ping = obj.PingPart:Clone()
print("cloned")
Ping.BillboardGui.PlayerName.Text = nm
Ping.Position = plr.Character.Torso.Position
Ping.Parent = game.Workspace
print("added to workspace")
db:AddItem(Ping,10)
print("debris")
end
sv_fire_ping.OnServerEvent:Connect(CreatePing)
This system completely ignores the second argument (pos) to get the mouse’s CFrame position. The “Ping.Position” was changed to what it is now simply to check if my code was working at all (which it was).
I would be very appreciative if someone were to help me, even if the solution to this problem is just an issue of lack of common knowledge.