I am having trouble with this script I made… It is located in a part in a custom character labeled StarterCharacter in the StarterPlayer folder. The script is a local script and there are no errors in the output.
local sp = script.Parent --Ignore
local Bullet = game.ReplicatedStorage["Bullet"] --Ignore
local folder = game.Workspace.Bullets --Ignore
local UIS = game:GetService("UserInputService")
local function onInputBegan(input, gameProcessed)
if input.UserInputType == Enum.UserInputType.F then
print("Script works")
end
end
UIS.InputBegan:Connect(onInputBegan)
Thanks!
(And note I’m not that great with scripting so sorry in advance)
UserInputType can determine the platform in which the player is running the game. Instead, use KeyCode which is a list of all keyboard keys.
local function onInputBegan(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.F then
print("Script works")
end
end
UIS.InputBegan:Connect(onInputBegan)