Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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?

0
you realize you can just do tool.Activated in the server script, right? Reset8449879 204 — 4y
0
no i don't- how does that work? Logophilic 37 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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")
0
i used gay.Parent = workspace.Magic Logophilic 37 — 4y
0
Oh, I didn't see it. DbExpress 20 — 4y
0
Is the character R15 or R6, if the player is R15 set "char.Torso.Position" to "char.HumanoidRootPart.Position" DbExpress 20 — 4y
Ad
Log in to vote
0
Answered by
Lunaify 66
4 years ago
Edited 4 years ago

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

0
Didn't work... Logophilic 37 — 4y
0
any errors in the output???? Lunaify 66 — 4y

Answer this question