Server
local NIceV = IceV:Clone()
NIceV.Parent = game.Workspace
game.Debris:AddItem(NIceV,3)
NIceV.Position = Vector3.new(Mousepos) * Vector3.new(0,0,0)
Local
UIS.InputBegan:connect(function(Input, isTyping)
if isTyping then
return
elseif not CanFire and Input.KeyCode == Enum.KeyCode.X and Enabled == true and Opened == true then
if isCasting == true then return end
CanFire = true
cast:Play()
trail(Character,Character["Right Arm"],1.5)
local Casting = script.RemoteEvent.Script.Casting:Clone()
Casting.Parent = Character.HumanoidRootPart
Casting.Pitch = 1.15 * (math.random(90, 110) / 100)
Casting:Play()
wait(1.5)
CanFire = false
elseif CanFire and not isCasting and Input.UserInputType == Enum.UserInputType.MouseButton1 then
isCasting = true
cast:Stop()
print("Fired")
player.Mana.Value = player.Mana.Value - 0.05
local Mousepos = Mouse.hit.p
script.RemoteEvent:FireServer("Second", Mousepos)--Whatever function you would like to call
wait(3)
isCasting = false
end
end)
How would I make a part spawn where a player’s mouse is pointing?