I ran into a weird issue when messing around with userinputservice and didnt exactly know how to fix it?
LocalScript:
local uis = game:GetService(“UserInputService”)
local repStore = game:GetService(“ReplicatedStorage”)
uis.InputBegan:Connect(function(input, processed)
if input.UserInputType == Enum.UserInputType.Keyboard then
repStore.PartSpawn:FireServer(input.KeyCode)
end
end)
Script:
local uis = game:GetService(“UserInputService”)
local repStore = game:GetService(“ReplicatedStorage”)local function spawnPart(player, input)
if input == Enum.KeyCode.E then
local brick = Instance.new(“Part”, workspace)
brick.Position = Vector3.new(0,20,0)
elseif input == Enum.KeyCode.Q then
local sphere = Instance.new(“Part”, workspace)
sphere.Shape = Enum.PartType.Ball
sphere.Position = Vector3.new(0,20,0)
end
print(player … " pressed the " … uis:GetStringForKeyCode(input) … " key!") --where the issue is
endrepStore.PartSpawn.OnServerEvent:Connect(spawnPart)
It keeps outputting: “ServerScriptService.Script:13: attempt to concatenate Instance with string” and it wont print out anything besides that.