Here's the script,the problem is in the last few rows.
wait()
local event = script.Parent
event.OnServerEvent:Connect(function(player, Hit)
local anim = player.Character.Humanoid:LoadAnimation(script.Charge)
anim:Play()
local darknebula = Instance.new("Part")
darknebula.Shape = "Ball"
darknebula.Parent = player.Character.RightHand
darknebula.Size = Vector3.new(35, 35, 35)
darknebula.Color = Color3.fromRGB(0, 0, 0)
darknebula.Material = "Neon"
darknebula.Name = "darknebula"
darknebula.Massless = true
darknebula.CanCollide = false
local weld = Instance.new("Weld")
weld.Name = "Weld"
weld.Parent = darknebula
weld.Part1 = darknebula
weld.Part0 = player.Character.RightHand
weld.C0 = CFrame.new(0, 0, 0)
weld.C1 = CFrame.new(0, 35, 0)
local bg = Instance.new("BodyGyro",player.Character.UpperTorso)
bg.Name = "skillgyro"
bg.D = 100
bg.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
local bp = Instance.new("BodyPosition",player.Character.UpperTorso)
bp.Name = "skillposition"
bp.Position = player.Character.HumanoidRootPart.Position
bp.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
local Pos = Hit.p
bg.CFrame = CFrame.new(player.Character.UpperTorso.CFrame.p,Pos)
Here's the local script:
local players = game:GetService("Players")
local player = players.LocalPlayer
local char = player.Character
local humanoid = char:WaitForChild("Humanoid")
Enabled = true
local mouse = player:GetMouse()
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(key,isTyping) -- The key parameter gets filled with whatever key is pressed, and isTyping, or the second parameter is whether or not the player currently has the chat open.
if Enabled == false then return end
if key.KeyCode == Enum.KeyCode.Q and isTyping == false then
-- Script for when key is pressed here.
local Hit = mouse.Hit
workspace.Events.DemonAbilities["Dark Nebula"]:FireServer(Hit)
end
end)
UIS.InputEnded:Connect(function(key,isTyping)
if Enabled == false then return end
if key.KeyCode == Enum.KeyCode.Q and isTyping == false then -- Don't mind all the weird stuff with enum and crap, and just put the key you want after KeyCode.
-- When key is let go of script here.
workspace.Events.DemonAbilities.darknebulaweldoff:FireServer()
Enabled = false
end
wait(15)
Enabled = true
end)

25 comments
Yeah, give us 44 lines of unindented code only to tell us lt's "in the last few rows". What is the "last few rows" to you?
I'm finding your question a bit hard to understand, could you rephrase?
The last few rows are like from 32 to 44 also it's pretty hard to fit a whole question in only 100 words
Brother, what. Is. Your. Problem? answer that question for me, the FIRST out of all you've actually given insetad of undermining everyone like an a hole.
When i press the hotkey that activates this server script the character rotates towards the mouse and then stops, i need the character to be able to keep rotating when u move the mouse around.
Judging by the FE syntaxing above, there is another Script, could we see that?
this Rotating is an animation? they rotate (walk) to the Vector3 position of the mouse?
You should be able to see the local script now
then Stop rotating?
The character is supposed to get frozen in place and always face the mouse cursor, but what happens instead is he only faces the mouse cursor in the moment of activation and then stays frozen.
It's meant to be aiming a skill
It would be better if you removed the Players variable and just used the same index with.LocalPlayer at the end, also do workspace:FindFirstChild(Player.Name) for finding the Character, although your method works too
also just saying mouse.Hit.p instead
no need for a shortcut, I'm just giving you efficiency tips, what exactly are you indexing when firing the Server though
Have you tried .LookVector?
I am transfering the mouse cframe to the server script
Gonna try it now
Dont index the character from the workspace. You are being taught bad ways. Use the character property always
Someone told me that i should keep the mouse position updated, how can i do that in this situation?
Dont store it in a variable
Or do it client sided because a client has network ownership over their character
What exactly do u mean by that
You can move the player on the client side
You are right, how could i be so stupid
This question is a mess