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

Expected Indintifier When Pass variable name got )??

Asked by
vileras 22
2 years ago

Hello, So im having this issue when im trying to make an ability for a morph ive maded, Error: Expected Indintifier When Pass variable name got ), This happens in a server script.(Basically i fired a event from a local script to a server script.)

I will be grateful for every possible help!

(Im not a advanced scripter.)

Server Code:

local RS = game:GetService("ReplicatedStorage")
local Skull = RS:WaitForChild("SkullAbility")

Skull.OnServerEvent:Connect(function(player, Mouse)

    local Character = player.Character
    wait(0.9)
    local Fireball = Instance.new("Part")
    Fireball.Parent = workspace
    Fireball.CFrame = Character.HumanoidRootPart

    local Mesh = Instance.new("SpecialMesh")
    Mesh.Parent = Fireball
    Mesh.MeshId = "http://www.roblox.com/asset/?id=4770583"
    Mesh.TextureId = "http://www.roblox.com/asset/?id=76745352"

    Fireball.CanCollide = false
    Mesh.Scale = Vector3.new(2, 3.2, 3.2)
    Fireball.CFrame = CFrame.new(Fireball.Position, Mouse.Hit.p)

    local Particle = script.FireParticle:Clone()
    Particle.Parent = Fireball
    Particle.Enabled = true
    game.ReplicatedStorage.Skull.Damage:Clone().Parent = Fireball
    local Particle1 = game.ReplicatedStorage.Skull.Particle1:Clone()
    local Particle2 = game.ReplicatedStorage.Skull.Particle2:Clone()
    Particle1.Parent = Fireball
    Particle2.Parent = Fireball


    local Bv = Instance.new("BodyVelocity")
    Bv.Parent = Fireball
    Bv.MaxForce = Vector3.new(30000,30000,30000)
    Bv.Velocity = Character.HumanoidRootPart.CFrame.LookVector * 100
end)

2 answers

Log in to vote
0
Answered by 2 years ago

The only error I can see in your code is through FireBall.CFrame = Character.HumanoidRootPart.

If you change it to this it should work:

local Character = player.Character
wait(0.9)
local Fireball = Instance.new("Part")
Fireball.Parent = workspace
Fireball.CFrame = Character:WaitForChild("HumanoidRootPart").CFrame

0
Thanks for the suggest, Btw i think i should get the Character from the local script (i fixed the error but fire ball isn't working.) vileras 22 — 2y
Ad
Log in to vote
0
Answered by
vileras 22
2 years ago

The issue was that i maded a variable in a Local Script with the name player, I changed player to Player and it fixed. Thanks for the help thought.

Answer this question