So I'm trying to make it so that when the player presses F, an Asteroid falls from the sky. When I do it with a regular script it works, but with a Local Script it doesn't.~~~~~~~~~~~~~~~~~ local AST = game.ServerStorage.Asteroid local UIS = game:GetService("UserInputService")
AST:Clone()
UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.F then AST:Clone().Parent = workspace end end)
Please help!

8 comments
Well, I don't get any errors, but when I use the clone function, and I press F, nothing happens, I even set the parent as workspace using AST:Clone().Parent = worksapce
Are you using a ServerScript?
No, a local script. I put the local script in workspace.
Here's the script I used: local AST = game.ReplicatedStorage.Part local UIS = game:GetService("UserInputService") UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.F then AST:Clone().Parent = workspace end end)
LocalScripts aren't useable in Workspace. Use them in StarterPlayerScripts, StarterCharacterScripts, StarterGui, ReplicatedFirst, and the newly upcoming ReplicatedScriptService.
Okay, I'll try that.
Thanks, it helped!
No problem. Please accept my answer. There's been a bug where you can't see the accept answer button unless you go into incognito mode, so if the accept answer button doesn't show for you, use incognito mode.