So, I have this script where I press the KeyCode “B” and it’s supposed to spawn a part on me but I don’t see it anywhere. Here’s my script:
StarterPlayer > StarterCharacterScripts > Local Script>
local uis = game:GetService(“UserInputService”)
uis.InputBegan:Connect(function(input,gpe)
if input.KeyCode == Enum.KeyCode.B then
end
end)
ServerScriptService > Script:
local uis = game:GetService(“UserInputService”)
local re = game:GetService(“ReplicatedStorage”):WaitForChild(“Room”)
uis.InputBegan:Connect(function(input,gpe)
if input.KeyCode == Enum.KeyCode.B then
re:FireServer()
end
end)
ServerScriptService > Script2:
local re = game:GetService(“ReplicatedStorage”):WaitForChild(“Room”)
local function createPart(player)
local Part = Instance.new(“Part”)
Part.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -10)
Part.Anchored = true
Part.Parent = game.Workspace
end
re.OnServerEvent:Connect(createPart)
I also inserted a RemoteEvent called “Room” in ReplicatedStorage