Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Making a magic attack, but the part isn't even spawning?

Basically I'm working on making a magic attack, using FE. (I'm not experienced with FE so it is supposed to be super basic) The part that I am going to use for it isn't even spawning.

Local Script

local event = game.ReplicatedStorage.Pet
local plr = game.Players.LocalPlayer
local char = plr.Character or plr:WaitForChild("Character")
local tool = script.Parent

tool.Activated:Connect(function()
	event:FireServer(char.Torso.Position)
	end)

Server Script

local event = game.ReplicatedStorage.Pet
local plr = game.Players.LocalPlayer
local char = plr.Character or plr:WaitForChild("Character")

event.OnServerEvent:Connect(function(plr,position)
	local gay = Instance.new("Part")
	gay.Shape = "Ball"
	gay.BrickColor = BrickColor.new("Red")
	gay.Position = position
	gay.Parent = workspace.Magic
end)

Anyone know the problem?

2 comments

0

you realize you can just do tool.Activated in the server script, right?

0

no i don't- how does that work?

2 answers

You did not specify where you want the part to be placed in when created, it should be:

Instance.new("Part", workspace)

instead of just:

Instance.new("Part")

3 comments

0

i used gay.Parent = workspace.Magic

0

Oh, I didn't see it.

0

Is the character R15 or R6, if the player is R15 set "char.Torso.Position" to "char.HumanoidRootPart.Position"

LocalScript

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Magic = ReplicatedStorage:WaitForChild("Magic")

local Player = game.Players.LocalPlayer



script.Parent.Activated:Connect(function()
	Magic:FireServer(Player)
end)

Script



local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Magic = ReplicatedStorage:WaitForChild("Magic")



Magic.OnServerEvent:Connect(function(player,Player)
	local Character = Player.Character
	print(Character.Name)
	
	local HMRP = Character:WaitForChild("HumanoidRootPart")
	
	local Part = Instance.new("Part")
	Part.Parent = workspace
	Part.Shape = "Ball"
	Part.Size = Vector3.new(5,5,5)
	
	Part.CFrame = CFrame.new(HMRP.Position + Vector3.new(0,2,0))
	
end)

try this for now

2 comments

0

Didn't work...

0

any errors in the output????

This discussion is preserved as it was. New answers, comments, and votes are closed.