I converted a script from a localscript to be FE compatible, but now nothing will work. I changed the server OnServerInvoke function to just print the player's name, and that doesn't even work.

The local script for the server invoke in StarterGui

local player = game.Players.LocalPlayer
local CAS = game:GetService("ContextActionService")
local UIS = game:GetService("UserInputService")
local char = player.Character
local BlazeRF = game.ReplicatedStorage.BlazeInvoke
local debounce = false
local Mouse = player:GetMouse()
ButtonDown = true
function BlazeInvoke()
	if not debounce then
		debounce = true
		ButtonDown = true
		BlazeRF:InvokeServer(Mouse.Hit.p)
		wait(2)
		debounce = false
	end
end
Mouse.KeyDown:Connect(function(key)
	key = key:lower()
	if key == Enum.KeyCode.Q then
		BlazeInvoke()
	end
end)
Mouse.KeyUp:Connect(function(key)
	key = key:lower()
	if key == Enum.KeyCode.Q then
		ButtonDown = false
	end
end)

The server script

ButtonDown = true
game.ReplicatedStorage.RemoteFunctions.Magic.Blaze.BlazeInvoke.OnServerInvoke = function(plr, MouseHit)
	local char = workspace:WaitForChild(plr.name)
	local char = game.Workspace:WaitForChild(plr.Name)
	local tool = script.Parent
	local CAS = game:GetService("ContextActionService")
	local Mouse = plr:GetMouse()
	local RootPart = char:WaitForChild("HumanoidRootPart")
	local debounce = false
	local animation = script:WaitForChild("Animation")
	local hum = char.Humanoid
	local animTrack = hum:LoadAnimation(animation)
	local hitdebounce = false
	circle = game.ReplicatedStorage.MagicItems.MagicCircles.BlazeMagic.BlazeCircle:Clone()
		circle.Size = Vector3.new(10,10,0)
		circle.Parent = game.Workspace.CustomDebris
		circle.Anchored = false
		circle.CanCollide = false
		circle.Transparency = 1
		circle.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(10,0,0)
	
	local Weld = Instance.new("Weld")
		Weld.Parent = RootPart
		Weld.Part0 = RootPart
		Weld.Part1 = circle
		Weld.C0 = CFrame.new(1.5,0,-2)
	
	bp = Instance.new("BodyPosition")
		bp.Parent = char.Torso
		bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
		bp.Position = char.Torso.Position
		bg = Instance.new("BodyGyro")
		bg.D = 100
		bg.Parent = char.Torso
		bg.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
		bg.CFrame = CFrame.new(char.Torso.Position, MouseHit)
		if ButtonDown == true then
			for i = 1,110 do
				bg.cframe = CFrame.new(char.Torso.Position, Mouse.Hit.p)
				animTrack:Play()
				wait()
		if i == 110 then
			bg:Destroy()
			circle:Destroy()
			bp:Destroy()
			animTrack:Stop()
		end
		wait()
		if ButtonDown == false then break
			
		end
		end
		else 
			if ButtonDown == false then
				animTrack:Stop()
				end
			
			local fire = game.ReplicatedStorage.MagicItems.Particles.BlazeMagic.SunComet:Clone()
			fire.Parent = workspace.CustomDebris
			fire.CFrame = circle.CFrame*CFrame.new(0,0,-5)
			fire.Anchored = false
			fire.CanCollide = false
			fire.Transparency = 1
		local bv = Instance.new("BodyVelocity")
			bv.Parent = fire
			bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
			bv.Velocity = (Mouse.Hit.p - char.Torso.Position).unit*45
			bv.P = 500
		local tag = Instance.new("StringValue")
			tag.Parent = char
			tag.Name = "PlayerValue"
			tag.Value = plr.Name
			fire.Touched:Connect(function(hit)
				if not hitdebounce then
			hitdebounce = true
		
		fire:Destroy()
		if hit == circle then return end
		if hit.Parent:FindFirstChild("Humanoid") then
			if hit.Parent:FindFirstChild("PlayerValue") then
				if hit.Parent:FindFirstChild("PlayerValue").Value == plr.Name then
					hit.Parent:FindFirstChild("Humanoid"):TakeDamage(0)
				end
			else
				if hit.Parent:FindFirstChild(tag) == nil then
					hit.Parent:FindFirstChild("Humanoid"):TakeDamage(5)
				end
			end
			
		end
		local part = Instance.new("Part")
			part.CFrame = fire.CFrame
			part.Anchored = true
			part.CanCollide = false
			part.Material = "Neon"
			part.BrickColor = BrickColor.new("Deep orange")
			part.Parent = game.Workspace.CustomDebris
			part.Shape = "Ball"
		for i = 1, 20 do
			part.Transparency = part.Transparency + 0.085
			part.Size = part.Size + Vector3.new(7,7,7)
			wait()
		end
		local sun = game.ReplicatedStorage:WaitForChild("MagicItems").Particles.BlazeMagic.SunClone:Clone()
		local PE = sun.SunExplosion
			sun.Parent = workspace.CustomDebris
			sun.Position = fire.Position
			sun.CanCollide = false
			sun.Transparency = 1
			sun.Anchored = true
			PE.Enabled = true
		for i = 0, 1, .02 do
    		PE.Transparency = NumberSequence.new(i)

    		wait()
		end
		game.Debris:AddItem(part, 3)
		game.Debris:AddItem(sun, 3)
		game.Debris:AddItem(PE, 3)
		wait(3)
		hitdebounce = false
			end
		game.Debris:AddItem(fire,10)
			end)
		end
		end

What am I doing wrong?

1 comment

0

Are you getting any errors? You can't expect people to debug your 180 lines of code without any context.