Hi, I'm having trouble with a script. I need help on how to make a part spawn at the mouse location when the remote event is fired. Here is the remote event script -
local RP = game:GetService("ReplicatedStorage")
local Event = RP.Whirlwind.GaleTornado
local Tornado = RP.effects.hiTornado
Event.OnServerEvent:Connect(function(player, text, Mouse)
local character = player.Character or player.characterAdded:wait()
local clonedTornado = Tornado:Clone()
if text == "Pressed" then
print("test")
clonedTornado.CFrame = Mouse.CFrame
clonedTornado.Parent = workspace
end
end)
And here is the local script -
local UIS = game:GetService("UserInputService")
local attackTwo = Enum.KeyCode.X
local remoteMoveTwo = RP.Whirlwind.GaleTornado
local Mouse = game.Players.LocalPlayer:GetMouse()
UIS.InputBegan:Connect(function(input, gameProcessed, IsTyping)
if(not gameProcessed) then
if IsTyping or not equipped or debounce then return end
if(input.KeyCode == attackTwo) then
print("test")
remoteMoveTwo:FireServer("Pressed" , Mouse)
end
end
end)
Any help would be appreciated :)

2 comments
There is no "isTyping" parameter for InputBegan.
Because it would techincally be nil, it won't even fire because it's not true.