Cannot Create Part Inside Remote Event Scripts

I want to make a script that will create new part when a remote is fired. But It doesn’t even create the part (or maybe, it doesn’t even go to The Workspace, I don’t know… What I know is, no new part is created in The Workspace). But when I put the part creation lines outside the Remote FireServer Function, It works normally.

Here is my script:

local RS = game:GetService("ReplicatedStorage");
local remote = RS:FindFirstChild("Attack");

local TS = game:GetService("TweenService");

function onAction(player,char,power,action)
	if power == 1 then
		local hum = char:FindFirstChild("Humanoid");
		if action == 0 then
			local CBlast ="Part");
			CBlast.Shape = "Ball";
			CBlast.Name = "CBlast";
			CBlast.Color =,1,1);
			CBlast.Material = "Neon";
			CBlast.Size =,0.1,0.1);
			CBlast.Anchored = true;
			CBlast.Transparency = 0.5;
			CBlast.CFrame = char.HumanoidRootPart.CFrame;
			CBlast.Parent = char;
			hum.WalkSpeed = 0;
			local Tween1 = TS:Create(CBlast,,{
				Size =,5,5);
			hum.WalkSpeed = 16;
		elseif action == 1 then


The problem is not in the if statements, because it outputs “ABC”.

How do I fix it?

Client Code?

Or have you not scripted the elseif statement

It looks like you are not waiting for the tween to complete before destroying the part.

Add this right after Tween1:Play();:

1 Like

Oh I see… That’s the problem… Thank you :slight_smile:
(I can’t believe that I forgot something important like that :disappointed_relieved:)