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

Error Unexpected Unicode character: U+2028. Did you mean ''?

Asked by 4 years ago

The error occurs on line 11 whenever I start the game. I can't figure out whats going wrong.

local PhysicalCube = workspace.Cube
local replicatedstorage = game:GetService("ReplicatedStorage")
local remotes = replicatedstorage:WaitForChild("Remotes")

local function movementsuspend()
    print("EventFired")
    local parts = script.Parent:GetTouchingParts()

    for i, v in pairs(parts) do
        local part = workspace:FindFirstChild(parts)
        if part.Name == "Cube" then
            print("key suspended")
            PhysicalCube.SuspendedKeys.W.Value = true
        else
            PhysicalProperties.SuspendedKeys.W.Value = false
        end
    end
end

remotes:WaitForChild("W").OnServerFire:Connect(movementsuspend())
remotes:WaitForChild("S").OnServerFire:Connect(movementsuspend())
remotes:WaitForChild("A").OnServerFire:Connect(movementsuspend())
remotes:WaitForChild("D").OnServerFire:Connect(movementsuspend())

From what iv'e read its some kind of weird invisible character, and iv'e tried retyping the line, but its giving me the same error.

1 answer

Log in to vote
1
Answered by 4 years ago
local PhysicalCube = workspace.Cube
local replicatedstorage = game:GetService("ReplicatedStorage")
local remotes = replicatedstorage:WaitForChild("Remotes")

local function movementsuspend()
    print("EventFired")
    local parts = script.Parent:GetTouchingParts()

    for i, v in pairs(parts) do
        local part = v
        if part.Name == "Cube" then
            print("key suspended")
            PhysicalCube.SuspendedKeys.W.Value = true
        else
            PhysicalProperties.SuspendedKeys.W.Value = false
        end
    end
end

remotes:WaitForChild("W").OnServerFire:Connect(movementsuspend())
remotes:WaitForChild("S").OnServerFire:Connect(movementsuspend())
remotes:WaitForChild("A").OnServerFire:Connect(movementsuspend())
remotes:WaitForChild("D").OnServerFire:Connect(movementsuspend())
Ad

Answer this question