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

Don't know how to fix what output gave me?

Asked by 6 years ago
Edited 6 years ago

Output: 12:05:05.820 - ServerScriptService.SSJScript:31: '}' expected (to close '{' at line 29) near 'Parent'

game is filtering enabled this is a script in serverscriptservice that recieves the event when a localscript in startercharacterscripts fires it.

left out most of it so it won't get leaked only left part that needed fixing

THIS SCRIPT ISNT THE SCRIPT I STARTED WITH WHEN I MADE THIS QUESTION

--//Variables
hatsRemoved = false
local rp = game:GetService("ReplicatedStorage")
local ssjHair = rp:WaitForChild("SSJ1").SSJ
local ssjParticles = rp:WaitForChild("SSJ1").SSJparticles
--local camScript = script.camScript
--//Instances
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/Asset?ID=1226733054"
animTrack = nil
local offanim = Instance.new("Animation")
offanim.AnimationId = "http://www.roblox.com/Asset?ID=1226813026"
--//Events
--local ssjEvent = rp:WaitForChild("SSJEvent")
--local offEvent = rp:WaitForChild("SSJOffEvent")
local ssjEvent = Instance.new("RemoteEvent", rp)
ssjEvent.Name = "SSJEvent"

--//Make rocks fly up with an animation facing up and not so loud ahhhhh sound
--//Thunder sounds
local lightningValues = {
    -- 1
    {
    Name = "EndPoint";
    Parent = game.Workspace.partChooserEnd;
    CFrame = char.RightFoot.CFrame + Vector3.new(-1, 0 , 0);
    };
    -- 2
    {
    Name = "StartPoint"
    Parent = game.Workspace.partChooserStart
    CFrame = char.Head.CFrame + Vector3.new(0, 100, 0)
    CFrame2 = CFrame.new(lightningp2.Position, Vector3.new(0,90,0))
    };
    -- 3
    {
    Name = "EndPoint2"
    Parent = game.Workspace.partChooserEnd
    CFrame = char.RightFoot.CFrame + Vector3.new(-3, 1 , 0)
    };
    -- 4
    {
    Name = "StartPoint2"
    Parent = game.Workspace.partChooserStart
    CFrame = char.Head.CFrame + Vector3.new(2, 100, 0)
    CFrame2 = CFrame.new(lightningp2.Position, Vector3.new(0,90,0))
    };
    -- 5
    {
    Name = "EndPoint3"
    Parent = game.Workspace.partChooserEnd
    CFrame = char.RightFoot.CFrame + Vector3.new(5, 1 , 0)
    };
    -- 6
    {
    Name = "StartPoint3"
    Parent = game.Workspace.partChooserStart
    CFrame = char.Head.CFrame + Vector3.new(-4, 100, 0)
    CFrame2 = CFrame.new(lightningp2.Position, Vector3.new(0,90,0))
    };
    -- The following ones repeat ones above, if you want me to add these DM me on Discord, Era#5724
    -- {
    -- lightningp5.Name = "EndPoint4"
    -- lightningp5.Parent = game.Workspace.partChooserEnd
    -- lightningp5.CFrame = char.RightFoot.CFrame + Vector3.new(2, 1 , 0)
    -- };
    -- {
    -- lightningp6.Name = "StartPoint4"
    -- lightningp6.Parent = game.Workspace.partChooserStart
    -- lightningp6.CFrame = char.Head.CFrame + Vector3.new(2, 100, 0)
    -- lightningp6.CFrame = CFrame.new(lightningp2.Position, Vector3.new(0,90,0))
    -- }
};

local function ssjFired(plr)
print("Event recieved")
local char = game.Workspace:FindFirstChild(plr.Name)
local namee = plr.Name
local urFolder = rp:WaitForChild(namee)
local ssjE = urFolder:FindFirstChild("SSJenabled")
local plrNameValue = script.plrName
plrNameValue.Value = namee
    local ssjFound = rp:WaitForChild(namee)
    local SSJenabled = ssjFound:FindFirstChild("Value")
    char.Humanoid.Health = math.huge
    char.Humanoid.WalkSpeed = 0
    char.Humanoid.JumpPower = 0
    wait()
    animTrack = plr.Character.Humanoid:LoadAnimation(anim)
    animTrack:Play()
    --  camScript.Disabled = false
    wait()
    for i = 1,#lightningValues do
        local part = Instance.new("Part")
        part.Name = lightningValues[i].Name
        part.Parent = lightningValues[i].Parent
        part.CFrame = lightningValues[i].CFrame
        if lightningValues[i].CFrame2 then
            part.CFrame = lightningValues[i].CFrame2
        end
        part.Anchored = true
        part.Locked = true
        part.CanCollide = false
        part.Transparency = 1
        part.Size = Vector3.new(1,1,1)
    end
    local bolt = Instance.new("Part")
    bolt.Name = "LightningBolt"
    bolt.BrickColor = BrickColor.new(255, 255, 0)
    bolt.Material = "Neon"
    bolt.FormFactor = "Custom"
    bolt.CanCollide = false
    bolt.Anchored = true
    bolt.Size = Vector3.new(1, 1, 1)
    local p = Instance.new("Part")
    p.Parent = char
    p.Anchored = true
    p.CanCollide = false
    p.Transparency = 0
    p.formFactor = "Symmetric"
    p.Size = Vector3.new(0, 0, 0)
    p.TopSurface = "Smooth"
    p.BottomSurface = "Smooth"
    p.Name = "Sharingan"
    p.Shape = "Ball"
    p.Material = "Neon"
    p.CFrame = char.UpperTorso.CFrame
    p.BrickColor = BrickColor.new("New Yeller")

        function shootElectrode(from, to)
            local lastPos = from
            local step = 16
            local off = 32
            --local range = 500

            local distance = (from-to).magnitude
            --if distance > range then distance = range end
            for i = 0,distance, step do
                local from = lastPos

                local offset = Vector3.new(
                    math.random(-off,off),
                    math.random(-off,off),
                    math.random(-off,off)
                )/10

                local to = from + -(from-to).unit*step + offset

                local p = bolt:Clone()
                p.Parent = game.Workspace.ExtraParts
                p.Size = Vector3.new(p.Size.X, p.Size.Y, (from-to).magnitude)
                p.CFrame = CFrame.new( from:Lerp(to,.5) , to  )
                game.Debris:AddItem(p,.3)
                lastPos = to
                wait()
            end
        end
            for i = 1,7 do
                wait(0.05)
                p.Size = p.Size + Vector3.new(4, 4, 4)
                p.Transparency = p.Transparency + 0.2
                p.CFrame = char.UpperTorso.CFrame
            end 
            p.Size = Vector3.new(24, 24, 24)
            p.Transparency = 0
        local growingS = script.growingScript
        growingS.Disabled = false
            for l = 1,10 do
                wait()
                local partChooser = workspace.partChooserStart
                local partChooser2 = workspace.partChooserEnd
                local random1 = partChooser:children()[math.random(1,#partChooser:children())]
                local random2 = partChooser2:children()[math.random(1,#partChooser2:children())]
            --  print(random1.Name)
            --  print(random2.Name)
                local from = random1.Position
                local to = random2.Position

                shootElectrode(from, to)

                local partChooser = workspace.partChooserStart
                local partChooser2 = workspace.partChooserEnd
                local random1 = partChooser:children()[math.random(1,#partChooser:children())]
                local random2 = partChooser2:children()[math.random(1,#partChooser2:children())]
            --  print(random1.Name)
            --  print(random2.Name)
                local from = random1.Position
                local to = random2.Position

                shootElectrode(from, to)
        end
end

ssjEvent.OnServerEvent:connect(ssjFired)

0
Yes if you have FilteringEnabled on then it is due to the localscript since whatever you're creating with your localscript isn't being created in the server and to everyone else. Ultimate_Piccolo 201 — 6y
0
Is it possible to convert this into a script? Godlydeathdragon 227 — 6y
0
Yes if you want it to be filtering enabled. You need to fire a remote event from the local script using :FireServer(). Then you'll need to listen for when the event is fired with a normal script using .OnServerEvent Ultimate_Piccolo 201 — 6y
0
Thanks, It worked. Godlydeathdragon 227 — 6y

1 answer

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

To help with what's in the comments, I'm not sure how good you are with FE and scripting as a whole but I wrote some of the server side for you, condensing it a bit.

-- // Server Script \\
-- // Variables \\
local replicatedStorage = game:GetService("ReplicatedStorage")
local hatsRemoved = false
local event = Instance.new("RemoteEvent")
local rfunction = Instance.new("RemoteFunction")
event.Parent = game.ReplicatedStorage
event.Name = "event"
rfunction.Name = "function"

local lightningValues = {
    -- 1
    {
    Name = "EndPoint";
    Parent = game.Workspace.partChooserEnd;
    CFrame = char.RightFoot.CFrame + Vector3.new(-1, 0 , 0);
    };
    -- 2
    {
    Name = "StartPoint"
    Parent = game.Workspace.partChooserStart
    CFrame = char.Head.CFrame + Vector3.new(0, 100, 0)
    CFrame2 = CFrame.new(lightningp2.Position, Vector3.new(0,90,0))
    };
    -- 3
    {
    Name = "EndPoint2"
    Parent = game.Workspace.partChooserEnd
    CFrame = char.RightFoot.CFrame + Vector3.new(-3, 1 , 0)
    };
    -- 4
    {
    Name = "StartPoint2"
    Parent = game.Workspace.partChooserStart
    CFrame = char.Head.CFrame + Vector3.new(2, 100, 0)
    CFrame2 = CFrame.new(lightningp2.Position, Vector3.new(0,90,0))
    };
    -- 5
    {
    Name = "EndPoint3"
    Parent = game.Workspace.partChooserEnd
    CFrame = char.RightFoot.CFrame + Vector3.new(5, 1 , 0)
    };
    -- 6
    {
    Name = "StartPoint3"
    Parent = game.Workspace.partChooserStart
    CFrame = char.Head.CFrame + Vector3.new(-4, 100, 0)
    CFrame2 = CFrame.new(lightningp2.Position, Vector3.new(0,90,0))
    };
    -- The following ones repeat ones above, if you want me to add these DM me on Discord, Era#5724
    -- {
    -- lightningp5.Name = "EndPoint4"
    -- lightningp5.Parent = game.Workspace.partChooserEnd
    -- lightningp5.CFrame = char.RightFoot.CFrame + Vector3.new(2, 1 , 0)
    -- };
    -- {
    -- lightningp6.Name = "StartPoint4"
    -- lightningp6.Parent = game.Workspace.partChooserStart
    -- lightningp6.CFrame = char.Head.CFrame + Vector3.new(2, 100, 0)
    -- lightningp6.CFrame = CFrame.new(lightningp2.Position, Vector3.new(0,90,0))
    -- }
};
-- // Functions \\

function ssj(args)
    wait(1)
    local plr = args[1]
    local char = plr.Character
    local humanoid = char:WaitForChild("Humanoid")
    local name = plr.Name
    local ssjEvent = replicatedStorage:WaitForChild("SSJ1")
    local ssjHair = ssjEvent.SSJ
    local ssjParticles = ssjEvent.SSJparticles
    local ssjFound = replicatedStorage:WaitForChild(name)
    local ssjEnabled = ssjFound:FindFirstChild("Value")
    local offEvent = rp:WaitForChild("SSJOffEvent")
    local anim = Instance.new("Animation")
    local offAnim = Instance.new("Animation")
    anim.AnimationId = "rbxassetid://1226733054"
    animTrack = nil
    offAnim.AnimationId = "rbxassetid://1226813026"
    animTrack = plr.Character.Humanoid:LoadAnimation(anim)
    animTrack:Play()
    humanoid.Health = math.huge
    humanoid.WalkSpeed = 0
    humanoid.JumpPower = 0
    wait()
    for i = 1,#lightningValues do
        local part = Instance.new("Part")
        part.Name = lightningValues[i].Name
        part.Parent = lightningValues[i].Parent
        part.CFrame = lightningValues[i].CFrame
        if lightningValues[i].CFrame2 then
            part.CFrame = lightningValues[i].CFrame2
        end
        part.Anchored = true
        part.Locked = true
        part.CanCollide = false
        part.Transparency = 1
        part.Size = Vector3.new(1,1,1)
    end
    local bolt = Instance.new("Part")
    bolt.Name = "LightningBolt"
    bolt.BrickColor = BrickColor.new(255, 255, 0)
    bolt.Material = "Neon"
    bolt.FormFactor = "Custom"
    bolt.CanCollide = false
    bolt.Anchored = true
    bolt.Size = Vector3.new(1, 1, 1)
    local p = Instance.new("Part")
    p.Parent = char
    p.Anchored = true
    p.CanCollide = false
    p.Transparency = 0
    p.formFactor = "Symmetric"
    p.Size = Vector3.new(0, 0, 0)
    p.TopSurface = "Smooth"
    p.BottomSurface = "Smooth"
    p.Name = "Sharingan"
    p.Shape = "Ball"
    p.Material = "Neon"
    p.CFrame = char.UpperTorso.CFrame
    p.BrickColor = BrickColor.new("New Yeller")
end

function shootElectrode(from, to, bolt)
    local lastPos = from
    local step = 16
    local off = 32
    --local range = 500

    local distance = (from-to).magnitude
     --if distance > range then distance = range end
    for i = 0,distance, step do
    local from = lastPos

    local offset = Vector3.new(
        math.random(-off,off),
        math.random(-off,off),
        math.random(-off,off)
    )/10

    local to = from + -(from-to).unit*step + offset

    local p = bolt:Clone()
    p.Parent = game.Workspace.ExtraParts
    p.Size = Vector3.new(p.Size.X, p.Size.Y, (from-to).magnitude)
    p.CFrame = CFrame.new( from:Lerp(to,.5) , to  )
    game:GetService("Debris"):AddItem(p,.3)
    lastPos = to
    wait()
    end
end


-- // Events \\
rfunction.OnServerInvoke = ssj()
    event.OnServerEvent:Connect(function(plr)
end)
0
output says 23:23:28.943 - ServerScriptService.SSJScript:31: '}' expected (to close '{' at line 29) near 'Parent' what did i do wrong? script above is replaced with new script. Godlydeathdragon 227 — 6y
Ad

Answer this question